How to install webmin on a Debian 9 VPS
Webmin is a web-based control panel designed to simplify the operation of system administrators – handling Linux systems. This is a powerful system configuration tool that makes it easy to share files, set up user accounts, DNS, Apache, and more. The tool reduces the time required to manually modify Unix configuration files like / etc / passwd and allows administrators to manage their system from one unified console.
This guide will show you how to install and set up Webmin on a Debian 9 VPS. Besides, you’ll learn how to access this interface with a valid Let’s Encrypt certificate.
- Conditions to install webmin
- Debian 9 server fully configured
- LAMP stack installed on your system
- Domain pointing to your server
2. Install webmin trên Debian 9 VPS
Tep 1: Install Webmin tool
The first thing when installing Webmin on Debian 9 is to add the Webmin repository to your system. Adding repositories makes it easy to install Webmin using the package manager.
To add an archive, open the list of files / etc / apt / sources using your favorite text editor:
|1||$ sudo nano /etc/apt/sources.list|
Add the following line to this file:
|. . .|
deb http://download.webmin.com/download/repository sarge contrib
Save these changes and exit the nano editor
To make sure your system is indeed added to the repository, you must add the PGP key to Webmin
Run the command below to add this key:
|$ wget http://www.webmin.com/jcameron-key.asc|
$ sudo apt-keyadd jcameron-key.asc
Now execute the command below to install webmin:
|1||$ sudo apt install webmin|
The system will automatically install webmin and provide the following output when the process is finished:
|Webmin install complete. You can now login to|
https://your_server_ip:10000as root with your
root password, orasanyuser who can use`sudo`.
Step 2: Secure your access to Webmin
Webmin is designed to automatically use an insecure self-signed SSL certificate. To enhance the security of your installations, you should use Let’s Encrypt certificate for authentication.
Now go to your browser and search https: // your_domain:10000 and remember to replace your_domain with your domain name.
Note: Since the server has automatically generated an untrusted, self-signed certificate, you’ll get an error saying “Invalid SSL” the first time you log in. Just allowing this exception to continue can replace the self-signed certificate for the Let’s Encrypt certificate.
You will see the following login screen:
Log in with your system admin credentials (username and password) to view the main Webmin dashboard.
Before you deploy a valid Let’s encryption certificate, set the hostname of your server. Find the System hostname section of Webmin. To the right of this field, there is an expandable link. Click that link to access the Hostname DNS Client section / page. Once you are on this page, navigate to the Hostname section and provide your FQDN. Click Save to implement the changes.
- Next, navigate to Webmin> Webmin Configuration> SSL Encryption> Let’s Encrypt.
Once you are on this page, you can now instruct Webmin to obtain and renew the Let’s Encrypt certificate. Although the Certificate is valid for three months, you can request that Webmin renew automatically every month.
- Follow the steps below to configure Let’s Encrypt certificates.
In the Hostnames for certificate field, enter your Fully Qualified Domain Name (FQDN)
Next, in the Website root directory for validation file section, tick Other Directory, / var / www / html – is the directory where Webmin will store all verification files.
Do not change the option Copy new key and certificate to Webmin; leave the default value (Yes).
Click SSL key size can be set to default value. Also, tick the other option and choose your preferred key size.
The next part is Months between automatic renewal. Enter 1 in the box to deactivate the Only renew manually option, then choose another option.
Once you have everything set up, click Request Certificate. It will take approximately thirty seconds to receive a confirmation message.
Step 3: Manage Webmin
- Start Webmin
To restart webmin and use the Let’s Encrypt certificate, click the browser’s back arrow, then click Restart Webmin. Wait 30 seconds before reloading this page to login. Your web browser will not display an invalid SSL error.
Alternatively, you can execute the following command to restart Webmin:
|1||$ sudo systemctl start webmin|
If you want to stop webmin, run the command below:
|1||$ sudo systemctl stop webmin|
|1||$ sudo systemctl restart webmin|
Next, to check the status of this service, run the following command:
|1||$ systemctl status webmin|
If you find the webmin package is not suitable for your system or is not able to meet your needs, you can uninstall it easily. Just run the following simple commands to uninstall the service:
|1||$ sudo apt-get –purge remove webmin|
The above command will stop Webmin from working and delete all its files from your Debian server. Besides, all configurations related to Webmin will be removed. For this reason, you should make sure that deleting the package won’t affect important aspects of your system.