How to Install Webmin with Free Let's Encrypt SSL on Ubuntu 24.04
Webmin is a web-based interface for managing Linux servers. This guide will walk you through the steps to install Webmin on an Ubuntu 24.04 server and secure it with a free Let's Encrypt SSL certificate.
Step 1: Update Your System
- Start by updating your system packages:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Dependencies
- Install necessary packages such as curl and gnupg:
sudo apt install curl gnupg2 ca-certificates lsb-release -y
Step 3: Add Webmin Repository
- Add the Webmin repository and its GPG key to your system:
curl -fsSL https://download.webmin.com/jcameron-key.asc | sudo tee /etc/apt/trusted.gpg.d/jcameron-key.asc
- Create the Webmin repository file:
sudo sh -c 'echo "deb https://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list'
- Update the package list:
sudo apt update
Step 4: Install Webmin
- Now, install Webmin using the following command:
sudo apt install webmin -y
Once installed, Webmin will automatically start. You can check its status with:
sudo systemctl status webmin
Step 5: Access Webmin
- Webmin runs on port 10000 by default. To access Webmin, open a web browser and navigate to:
URL: https://your-server-ip:10000
Since you don't have an SSL certificate yet, you may receive a warning about the security of the connection. You can safely bypass this warning for now.
Step 6: Install Certbot for Let's Encrypt
- To obtain a free SSL certificate from Let's Encrypt, you need to install Certbot. Run the following command:
sudo apt install certbot -y
Step 7: Configure Webmin for SSL with Let's Encrypt
- Once Certbot is installed, log in to Webmin and follow these steps to configure Let's Encrypt:
- Go to Webmin Configuration on the Webmin dashboard.
- Click on SSL Encryption.
- In the Let's Encrypt tab, configure the following:
- Hostname for certificate: Enter your domain name (e.g.,
yourdomain.com
). - Website root directory: Set it to
/var/www/html
or your web root directory. - Renewal options: Enable the option to renew automatically every two months.
- Hostname for certificate: Enter your domain name (e.g.,
- Click Request Certificate to obtain the SSL certificate.
Step 8: Open Ports in UFW Firewall (Optional)
- If you are using UFW as your firewall, allow ports 10000 (Webmin) and 443 (HTTPS) by running:
sudo ufw allow 10000/tcp sudo ufw allow 443/tcp
Step 9: Verify SSL Certificate
- After the certificate has been issued, you can access Webmin securely using HTTPS. Navigate to:
URL: https://yourdomain.com:10000
Your connection should now be secured with a Let's Encrypt SSL certificate.
Conclusion
You've successfully installed Webmin on Ubuntu 24.04 and secured it with a free Let's Encrypt SSL certificate. You can now manage your server securely via the Webmin interface. Be sure to renew the SSL certificate as needed, although Let's Encrypt usually handles automatic renewals.