Skip to main content
How to Install Cockpit on Debian for Beginner Home Server Management

How to Install Cockpit on Debian for Beginner Home Server Management

·1981 words·10 mins
Zarvelion Zynji
Author
Zarvelion Zynji
Tech enthusiasts (self-proclaimed). Gaming addict (diagnosed). Anime simp (no regrets). I turn my hyperfixations into contentβ€”welcome to the chaos.
Table of Contents

Tired of the black screen full of commands? I’m sure many of you, especially those who are used to Windows or a graphical user interface (GUI), feel a little overwhelmed when you have to manage a Linux Debian home server using the Command Line Interface (CLI).

I completely understand that feeling. You intend to create a personal server for data storage, a media center, or to experiment with Docker, but instead, you get stuck in the terminal. Your awesome home server becomes a useless object because you’re too afraid to touch it.

Well, it’s time for you to get to know Cockpit! πŸŽ‰

Cockpit is like a sophisticated window that you can open on any browser (on a PC, laptop, or even a phone/tablet) to control everything on your Debian home server. From monitoring performance, updating the system, and managing storage to installing additional applications, everything can be done with just a few clicks, without having to worry about complex Linux command syntax. It’s perfect for those who are new to Linux or want quick and easy server administration.

This article will be your complete guide. I’ll show you how to install Cockpit on Debian and how to maximize its functions, including some cool add-ons that are a must-have for a home server!


πŸš€ How to Install Cockpit on Debian
#

The process of installing Cockpit on Debian is very easy, as long as you have root access or a user with sudo privileges.

1️⃣ First, Update the System
#

This is always a good first step! Make sure the package list and all installed packages on your server are the latest versions.

sudo apt update
sudo apt upgrade -y

2️⃣ Install the Cockpit Package
#

Cockpit is available in the official Debian repositories, so you don’t need to bother adding external repositories.

sudo apt install cockpit -y

3️⃣ Verify and Enable the Service
#

By default, after installation, cockpit.socket is usually active and running thanks to systemd. But, it doesn’t hurt to check and make sure.

# This command ensures the Cockpit socket service is active and starts at boot
sudo systemctl enable --now cockpit.socket

# Check its status
sudo systemctl status cockpit

You should see the status Active: active (running).

4️⃣ Configure the Firewall (UFW)
#

Cockpit runs on TCP port 9090. If you’re using UFW (Uncomplicated Firewall) on your server, you need to open this port so it can be accessed externally.

# Open port 9090
sudo ufw allow 9090/tcp

# Reload UFW
sudo ufw reload

5️⃣ Access Cockpit via a Web Browser
#

Open your browser and type the address: https://[Your_Server_IP]:9090.

Important: Because Cockpit uses a self-signed SSL certificate, your browser may display a security warning. Just ignore it or add an exception.

You will enter the login page. Use the Username and Password of a Linux user on your server (one with sudo privileges).


πŸ—ΊοΈ A Tour of Cockpit’s Main Features: Your Home Server Dashboard
#

After logging in, you’ll be greeted by an informative dashboard. Here are some key features you’ll use frequently:

Main Dashboard
#

Here you can see an important summary of your server’s health:

  • Performance: Real-time graphs of CPU, Memory, Disk I/O, and Network Traffic usage. This is key for monitoring if any applications are consuming too many of your server’s resources.

  • System Information: Basic information about the server’s OS and hardware.

  • Health: System status and alerts for any serious issues.

βš™οΈ Services
#

In this section, you can manage all the services (systemd services) running on the server.

  • Start, Stop, Restart: It’s incredibly easy, just click the button. For example, you can restart your web server service (like Nginx or Apache) without having to type sudo systemctl restart nginx.

  • Enable/Disable: Control which services should automatically run when the server boots.

πŸ’Ύ Storage
#

This is really important for a home server! You can:

  • Disks: View all connected hard disks, including partitions, usage, and health.

  • Filesystems: Manage mount points and view filesystem details.

  • RAID/LVM: If you have a more complex storage setup, Cockpit also supports managing RAID arrays and Logical Volume Management (LVM).

🌐 Networking
#

  • Interface: Configure IP settings, subnet masks, and gateways for each network interface.

  • Firewall: Manage firewall rules (firewalld or iptables) graphically. You can easily open or close specific ports.

πŸ“œ Logs
#

This section displays the Journal Log from systemd. If your server has a problem, this is the first place you should check. Cockpit presents the logs in a format that’s easy to read and can be filtered, which is much more convenient than having to tail -f /var/log/syslog in the terminal.

πŸ§‘ Accounts
#

You can add, delete, or change passwords for users on your server. This is important for home server security.

⌨️ Terminal
#

This is a lifesaver feature! Cockpit has a built-in Terminal that runs in the browser. So, even if you need CLI access, you no longer need a separate SSH client. You can perform all CLI commands directly from here.


πŸ› οΈ Awesome Cockpit Add-ons for Your Home Server
#

Cockpit becomes even more powerful because of its support for third-party applications (often called cockpit-plugins). Here are three add-ons that I think you must have, especially for a home server:

1. πŸ“‚ Cockpit File Sharing (Samba & NFS Manager)
#

This add-on was created by 45Drives, and its function is to make it easier for you to share files on your home network, using either the Samba protocol (for connecting to Windows/Mac) or NFS (for other Linux systems).

πŸ› οΈ Installation & Usage
#

For Debian, the easiest way is to download and install the .deb package directly from its GitHub release page. Make sure you’ve already installed Samba and NFS on your Debian system.

  1. Install Dependencies (Samba and NFS):

    sudo apt install samba nfs-kernel-server samba-common-bin -y
    
  2. Download and Install cockpit-file-sharing:

    Check the release page for the latest version, then replace the URL below with the current version. Find the latest .deb link at https://github.com/45Drives/cockpit-file-sharing/releases Example

    wget https://github.com/45Drives/cockpit-file-sharing/releases/download/vX.Y.Z/cockpit-file-sharing_X.Y.Z-1focal_all.deb
    sudo apt install ./cockpit-file-sharing_X.Y.Z-1focal_all.deb
    
  3. Access the Feature: After refreshing the Cockpit page, you’ll see a new menu for File Sharing. From here, you can:

    • Samba: Create a new share, specify the folder path on the server, and set who has access (Valid Users or Valid Groups).

    • NFS: Configure which directories to export and which clients are allowed to access them.


2. πŸ†” Cockpit Identities (User & Samba Password Manager)
#

Since cockpit-file-sharing requires separate management for Samba users and passwords, this add-on is very important for managing credentials. This add-on is also from 45Drives and is a must-have companion for file sharing.

πŸ› οΈ Installation & Usage
#

Just like with file sharing, we’ll download the .deb package from GitHub and install it.

  1. Download and Install cockpit-identities:

    Find the latest .deb link at https://github.com/45Drives/cockpit-identities/releases

    Example:

    wget https://github.com/45Drives/cockpit-identities/releases/download/vX.Y.Z/cockpit-identities_X.Y.Z-1focal_all.deb
    sudo apt install ./cockpit-identities_X.Y.Z-1focal_all.deb
    
  2. Access the Feature: Refresh Cockpit and go to the Identities menu.

  • User Management: Here you can create new users and set their Linux passwords.
  • Samba Password: Most importantly, you can set the Samba password for a specific user. This is the password that the user will use to access your Samba shares from Windows or Mac. Remember, the Samba password doesn’t have to be the same as their Linux password!

3. 🐳 Cockpit Docker Manager
#

For those who love Docker (and who doesn’t love containers for a home server?), this add-on is a dream. You can manage all your Docker/Podman containers and images without typing a single docker command!

Important: Make sure you’ve already installed Docker on your server before installing this add-on.

πŸ› οΈ Installation & Usage
#

We’ll use cockpit-dockermanager from a third party (chrisjbawden) because its features are a better fit for a modern home server.

  1. Install Dependencies (Docker):

    # Example Docker installation (if not already installed) 
    
    # Update package index
    sudo apt update
    
    # Install paket dependensi
    sudo apt install -y ca-certificates curl gnupg
    
    # Add Docker's official GPG key
    sudo install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    sudo chmod a+r /etc/apt/keyrings/docker.gpg
    
    # Setup repository Docker
    echo \
      "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
      "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
    # Install Docker Engine
    sudo apt update
    sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    
    # Verify the installation
    sudo docker run hello-world
    
    # Add your user to the docker group so you don't need sudo with docker commands
    sudo usermod -aG docker [username_anda]
    
  2. Download and Install cockpit-dockermanager: Get the .deb link from https://github.com/chrisjbawden/cockpit-docker-manager/ Example:

    wget https://github.com/chrisjbawden/cockpit-docker-manager/raw/main/dockermanager_1.0-1.deb
    sudo dpkg -i dockermanager_1.0-1.deb
    sudo apt install -f # Untuk memperbaiki dependensi jika ada
    
  3. Access the Feature: Refresh Cockpit, and you will see the Docker Manager menu. cockpit-dockermanager is quite simpleβ€”it can only show all running/stopped containers. You can Start, Stop, Restart, Delete, or even view a container’s Logs in real time.


🚨 Cockpit Troubleshooting and FAQ
#

Although Cockpit is designed to be easy, there are a few common issues you might encounter.

🐞 Common Troubleshooting
#

Problem Quick Fix CLI Commands to Check
Can’t access at https://IP:9090 Make sure port 9090 is open in UFW and the Cockpit service is running. sudo ufw status (Ensure 9090 is ALLOWED) and sudo systemctl status cockpit
Can’t log in or “Authentication failed” Ensure you are using the correct Linux username and password for a user on your server, and that the user is in the sudo group or has admin privileges. Try logging in via SSH with the same credentials.
Can’t perform admin tasks After logging in, you must click the “Enable administrative access” button on the dashboard and re-enter your password (similar to sudo). Make sure your user is in the sudo group.
Third-party plugin (e.g., File Sharing) doesn’t appear After installing the .deb, you need to refresh your Cockpit browser page. Also, make sure you installed a version that is compatible with your Debian distro. Check the plugins directory: ls /usr/share/cockpit/ (look for the folder of the plugin you installed).
Cockpit’s built-in “Terminal” isn’t working This could be a browser or WebSocket connection issue. Try clearing your browser cache or using a different browser. Check systemctl status cockpit.socket and systemctl status cockpit-ws (if it exists).

❓ Frequently Asked Questions (FAQ)
#

Q: Is Cockpit secure?
#

A: Yes, Cockpit is considered secure because:

  1. It runs on HTTPS (although it is self-signed, it can be replaced with a Let’s Encrypt certificate).

  2. It uses the same login and privilege system as your Linux system (PAM authentication). If your user cannot sudo, they also cannot perform administrative tasks in Cockpit.

Q: Can I access Cockpit from outside my home network (the Internet)?
#

A: You can, but it is highly not recommended to open port 9090 directly to the Internet. If you need remote access, use a more secure method like a VPN (Virtual Private Network) or SSH Tunneling.

Q: Does Cockpit replace Webmin or TrueNAS?
#

A: No. Cockpit is designed to be a lightweight and transparent interface for the Linux operating system. It doesn’t try to create its own abstraction or storage system like TrueNAS. Compared to Webmin, Cockpit is more modern, lighter, and more integrated with systemd. Cockpit is very suitable for a server whose purpose is a simple home server or homelab.

Q: How do I uninstall a plugin?
#

A: Since plugins are installed as .deb packages, you can remove them with the apt remove command. For example:

sudo apt remove cockpit-file-sharing cockpit-identities -y

Cockpit truly changes the way we manage a Linux home server. You no longer have to feel intimidated by the terminal. With a clear dashboard and add-ons like File Sharing, Identities, and Docker Manager, your Debian home server will become very easy to control, even from anywhere.

So, are you ready to become a reliable home server administrator without being a CLI expert? Try it now and feel the difference! πŸ§‘β€πŸ’»βœ¨

Related


Load Comments