How to Install and Use Midnight Commander on a VPS

July 8, 2025 / Servers, Hosting & Email

Midnight Commander (MC) is a powerful, text-based file manager designed to simplify file management tasks directly from the command line interface. When working on a virtual private server (VPS) without a graphical interface, Midnight Commander helps by providing a user-friendly, dual-pane interface for navigating, copying, moving, and editing files with comfort.

In this guide, you will learn how to install and use Midnight Commander on a VPS running Ubuntu or any Debian-based Linux distribution.

Follow the guide:

  1. Connect to your VPS using SSH if you haven’t already.
    ssh username@your-server-ip

    Note: Replace username and your-server-ip with your actual VPS username and IP address.

  2. Now, before installing any software, update the package list by using the following command to confirm you are getting the latest version from the repositories:
    sudo apt update
  3. Install Midnight Commander using the apt package manager:
    sudo apt install mc

    The above command installs both the Midnight Commander application and its dependencies.

  4. Once installed, start Midnight Commander by running:
    mc

    Once launched, Midnight Commander opens in a dual-pane layout directly in the terminal.

  5. Midnight Commander offers a range of keyboard shortcuts to simplify file management. Use Tab to switch between panes, arrow keys to navigate, and enter to open files or directories. Press F3 to view files, F4 to edit, F5 to copy, and F6 to move or rename. You can create directories with F7, delete items with F8, and exit the program using F10. These shortcuts make file operations quick and efficient directly from the terminal.
  6. Midnight Commander supports FTP and SFTP, which is useful if you need to connect to remote servers from your VPS:
    1. Press F9 > Left/Right > FTP link.
    2. Use the format:
      sftp://user@remote-host
  1. Custom configuration is also available. Settings can be modified and saved for your user by editing the configuration files located at:
    ~/.config/mc/

    You can also set your ideal editor, display options, and keybindings.

  2. Now, lastly, let us see how to uninstall Midnight Commander. If you ever want to remove it, use the command below:
    sudo apt remove mc

In this way, we can conclude that Midnight Commander is a highly effective tool for VPS users who operate primarily through the terminal. With its dual-pane user interface and keyboard-driven workflow, it simplifies complex file operations and makes managing your server more efficient.

For further assistance, feel free to contact our technical team.

Managing your VPS through WHM? Learn How to reboot a VPS or dedicated server via WHM

Spread the love