Categories
Raspberry Pi

How to install Webmin on Raspberry Pi 4

Install Webmin on Raspberry Pi is easy. Before we start, let me introduce Webmin. Webmin is a software that allows you to manage your Unix or Linux machine (e.g., Raspberry Pi) or server (e.g., Ubuntu server) through a web interface. This way, you can manage your machine on any browser remotely without having an SSH client: you can manage user accounts without editing /etc/passwd, Apache servers, DNS servers, Samba share, and a lot of system administration. Here is a list of standard modules that Webmin support and they come with the Webmin installation so you don’t have to manually install them.

Here you will learn how to install Webmin through the command line or terminal on Raspbian (the Raspberry Pi OS) through its official Debian repository, the easiest way and the most worry-less because you don’t need to download Webmin every time a new version come out and can just use apt update to update Webmin like other packages on you OS later.

Note that the instructions should also apply to other Debian-based Linux distributions like Ubuntu 20.04, 18.04, and Debian 10, 9.

Before installing Webmin on Raspberry Pi

You should have access to the terminal or can ssh into your machine. This won’t affect the installation process but the URL used to access Webmin will change, as you see later.

The user you used to log in should have root access. This is needed to install Webmin system-wide.

Set up Webmin Debian repo

First, we switch to the root user to avoid using sudo every time. After you run the following command, you will be prompted to enter your password. Then you will see you shell prompt change from $ to #.

sudo su

Next, we will append the official Webmin Debian repository to /etc/apt/sources.list. Use any editor, nano or vim, to open it and append this line https://download.webmin.com/download/repository sarge contrib. Save and quit your editor.

vim /etc/apt/sources.list
Add webmin debian repo to /etc/apt/sources.list

Next, we will need to get the package information from the Webmin Debian repository using apt update.

apt update

Now we’ll add the Webmin key to avoid the packages change over the network. As you may know, this is to avoid a man-in-middle attack. In the following, we switch to /tmp directory so we won’t need to delete the key we will download.

cd /tmp
wget https://download.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
add webmin key

Install Webmin on Raspberry Pi

Finally, we install Webmin through apt-get install webmin. You won’t succeed immediately as the package does not specify the dependencies it needed. But after you run it, you can use apt --fix-broken install to install the missing dependencies. It requires an extra step but it is not a hard one, fortunately. After apt --fix-broken installed all the dependencies, run apt-get install webmin again and this time it will succeed.

apt-get install webmin
apt --fix-broken install
apt-get install webmin

For your reference, the following are the dependencies (you can also install them by apt install apt-show-versions libauthen-pam-perl libio-pty-perl libnet-ssleay-perl perl-openssl-defaults beforehand but it is not needed):

  1. apt-show-versions
  2. libauthen-pam-perl
  3. libio-pty-perl
  4. libnet-ssleay-perl
  5. perl-openssl-defaults

Now, you can access Webmin by entering localhost:10000. the default port Webmin runs on is 10,000. If you ssh into the machine, you can use yourhostname:10000 to access Webmin. If you haven’t changed the hostname, you can access Webmin by raspberrypi:10000 where raspberrypi is the default hostname. In the following screenshot, because I have changed my machine hostname to rpi to allow easy access by just typing 3 letters, so I entered rpi:10000.

The login page you will see after you install Webmin
The login page you will see after you install Webmin

You can use your OS username and password to log in. The default login information for Raspbian on a Raspberry Pi is pi as username, and raspberry as password. After logged in, you will see the following web page, the home page of Webmin.

The front page of Webmin after you install Webmin
The front page of Webmin

Congratulations! Now you have Webmin installed can can manage your Linux/Unix machine from a browser.

In A Nutshell

Time Needed : 5 minutes

  1. Add Webmin Debian repository

    Run the following command to append https://download.webmin.com/download/repository sarge contrib to the sources.list file:

    sudo su
    vim /etc/apt/sources.list
    apt update

    image 30

  2. Add repo key

    We will download the key to /tmp and use apt-key to add it.

    cd /tmp
    wget https://download.webmin.com/jcameron-key.asc
    apt-key add jcameron-key.asc

    image 31

  3. Install Webmin package

    We install Webmin and use apt to install the dependencies for us automatically.

    apt-get install webmin
    apt --fix-broken install
    apt-get install webmin

    image 32

  4. Open Webmin

    Open http://localhost:10000 if you install on your Raspberry Pi directly.
    Open http://raspberrypi:10000 if you have not changed your hostname.
    Replace localhost with the hostname if you chose one. Mine is http://rpi:10000.2020 05 09

  5. Log in Webmin

    You don't need to register an account, and can just use your Linux username and password to login.2020 05 09 1

Tools
  • Terminal
  • SSH Client
  • wget
Materials
  • Linux

Reference: http://www.webmin.com/deb.html

1+

By VarHowto Editor

Welcome to VarHowto!

Leave a Reply

Your email address will not be published. Required fields are marked *