How to install and configure Webmin in Ubuntu 22.04

In this guide we will install and set up Webmin on an Ubuntu 22.04 server.

Webmin is a web-based system configuration tool for Unix-like systems, although recent versions can also be installed and run on Microsoft Windows. It s a free and open-source control panel for administering Unix/Linux servers.

Webmin provides users with a graphical web-based user interface to configure common system tasks and settings. If you don’t like the idea of using the command line to manage your server, then Webmin is a good graphical alternative to you. The following is a list of functionalities provided by Webmin.

  • BIND DNS Server: Create and edit domains, DNS records, BIND options and views
  • BSD Firewall : Configure a BSD firewall using IPFW, by creating and editing rules
  • DHCP Server: Manage shared networks, subnets, hosts, and groups for ISC DHCPD
  • CD Burner: Burn data CDs from ISO images or selected directories
  • File Manager : View, edit and change permissions on files and directories on your system with a Windows-like file manager
  • Dovecot IMAP/POP3 Server: Configure the Dovecot IMAP and POP3 mail retrieval server
  • LDAP Server: Manage the OpenLDAP server and objects in its database     All operating systems
  • **MySQL Database Server: **Setup databases, tables, and permissions in your MySQL database server
  • **Linux RAID: **Create RAID 0, 1, 4, 5, 6, 10 and linear devices on a Linux system
  • SSL certificates: Let’s Encrypt SSL certificate requests
  • **IPsec VPN Configuration: **Set up a client or server for an IPsec VPN using FreeSWAN

Table of Content

  1. Ensuring that the server is up to date
  2. Setting up webmin repo and installing webmin
  3. Starting and enabling the webmin service
  4. Open up Webmin service port on firewall
  5. Accessing webmin service in browser

1. Ensuring that the server is up to date

Before proceeding, it is always a good practice to ensure that the server is up to date. Use these commands to achieve this

sudo apt update
sudo apt upgrade -y

Ensure some required packages are installed

sudo apt install -y vim wget

2. Setting up Webmin repo and installing webmin

The recommended way of installing and using webmin is setting up the official repository. That way you will be able to keep up with the latest releases of webmin.

To add Webmin repository, create a source list file with a command-line text editor. Edit the /etc/apt/sources.list file on your system.

sudo vim /etc/apt/sources.list.d/webmin.list

Add the following line in the file.

deb https://download.webmin.com/download/repository sarge contrib

You should also fetch and install my GPG key with which the repository is signed, with the commands:

wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt-key add

Now we can update local package index and install Webmin.

sudo apt install apt-transport-https
sudo apt update
sudo apt install webmin

All dependencies should be resolved automatically. Once installed, you will get this output:

Setting up webmin (2.000) ...
Webmin install complete. You can now login to https://ip-10-2-40-248:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.13) ...

This shows that the service is running on our server in port 10000.

Confirm installation

$ apt-cache policy webmin
webmin:
  Installed: 2.000
  Candidate: 2.000
  Version table:
 *** 2.000 500
        500 https://download.webmin.com/download/repository sarge/contrib amd64 Packages
        100 /var/lib/dpkg/status

3. Starting and enabling the webmin service

The service is started by default. You can confirm the webmin service status using this command:

$ sudo systemctl status webmin
● webmin.service - Webmin server daemon
     Loaded: loaded (/lib/systemd/system/webmin.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-10-01 07:42:30 UTC; 1min 31s ago
    Process: 19068 ExecStart=/usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf (code=exited, status=0/SUCCESS)
   Main PID: 19069 (miniserv.pl)
      Tasks: 1 (limit: 4392)
     Memory: 27.6M
        CPU: 566ms
     CGroup: /system.slice/webmin.service
             └─19069 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

Oct 01 07:42:28 unstable-ubuntusrv systemd[1]: Starting Webmin server daemon...
Oct 01 07:42:28 unstable-ubuntusrv perl[19068]: pam_unix(webmin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Oct 01 07:42:30 unstable-ubuntusrv webmin[19068]: Webmin starting
Oct 01 07:42:30 unstable-ubuntusrv systemd[1]: Started Webmin server daemon.

To enable the webmin service on boot, use this command:

sudo systemctl enable webmin

4. Opening up webmin service port on firewall

If you installed and enabled ufw during the prerequisite step, you will need to run the following command in order to allow Webmin through the firewall:

sudo ufw allow 10000

For extra security, you may want to configure your firewall to only allow access to this port from certain IP ranges.

5. Accessing the webmin service in browser

Navigate to https://your_domain:10000 in your web browser, replacing your_domain with the domain name pointing to your server’s IP address.

Note: When logging in for the first time, you will see an “Invalid SSL” warning. This warning may say something different depending on your browser, but the reason for it is that the server has generated a self-signed certificate. Allow the exception and proceed to your domain.

You’ll be presented with a login screen. Sign in with a non-root user with sudo privileges present in the system. You can create a dedicated user for this.

Once you log in, the first screen you will see is the Webmin dashboard.

Citizix - Webmin Dashboard

Citizix – Webmin Dashboard

Wrapping Up

In this tutorial we learnt how to install Webmin on Ubuntu 22.04.

Last updated on Oct 14, 2024 11:46 +0300
comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy