How To Install Webmin Ubuntu 18.04 Bionic Beaver

Step 1: Install Webmin

1.1 Run commands in root

sudo su

1.2 Update and upgrade the server

sudo apt-get update && apt-get upgrade -y

1.3 Install Webmin package dependence

sudo apt-get -y install python apt-show-versions libapt-pkg-perl libauthen-pam-perl libio-pty-perl libnet-ssleay-perl

1.4 Download latest Webmin packages

sudo curl -L -O http://www.webmin.com/download/deb/webmin-current.deb
root@plex:/# sudo curl -L -O http://www.webmin.com/download/deb/webmin-current.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   249  100   249    0     0    651      0 --:--:-- --:--:-- --:--:--   650
100   380  100   380    0     0    307      0  0:00:01  0:00:01 --:--:--  1979
100   347  100   347    0     0    176      0  0:00:01  0:00:01 --:--:--   176
100 14.8M  100 14.8M    0     0  1171k      0  0:00:12  0:00:12 --:--:-- 1172k
root@plex:/# 

1.5 Install file with DPKG

sudo dpkg -i webmin-current.deb
root@plex:/# sudo dpkg -i webmin-current.deb
(Reading database ... 131839 files and directories currently installed.)
Preparing to unpack webmin-current.deb ...
Unpacking webmin (1.890) over (1.890) ...
Setting up webmin (1.890) ...
Webmin install complete. You can now login to https://plex.home.local:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10.3) ...
root@plex:/#

1.6 Add firewall rule for port 10000

sudo ufw allow 10000 

1.7 Logon to Webmin from a browser with a sudo account

https://YOUR.IP.ADDRESS:10000/

Step  2: Change Webmin default port

2.1 Edit Webmin configuration file

sudo nano -w /etc/webmin/miniserv.conf

2.1.a Replace port 10000

port="your-port"
addtype_cgi=internal/cgi
realm=Webmin Server

Exit and Save

2.1.b Restart Webmin

sudo systemctl restart webmin 

2.1.c Verify Webmin Service

sudo systemctl status webmin

2.2 Add new firewall rule for Webmin

sudo ufw allow "your-port"

2.3 Remove default Webmin port rule (Port 10000)

sudo ufw status numbered
root@plex:/# sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 888                        ALLOW IN    Anywhere
[ 2] 123/udp                    ALLOW IN    Anywhere
[ 3] 10000                      ALLOW IN    Anywhere
[ 4] 8888                       ALLOW IN    Anywhere
[ 5] 888 (v6)                   ALLOW IN    Anywhere (v6)
[ 6] 123/udp (v6)               ALLOW IN    Anywhere (v6)
[ 7] 10000 (v6)                 ALLOW IN    Anywhere (v6)
[ 8] 8888 (v6)                  ALLOW IN    Anywhere (v6)

root@plex:/#

2.3.a Delete rule

sudo ufw delete 3

2.3.b Repeat for ipv6 rule

2.4 Login to Webmin on new port

https://YOUR IP ADDRESS:8888/

Donate