Webmin is a powerful web-based interface for system administration for Unix. Using any modern web browser, you can set up user accounts, Apache, DNS, file sharing, and much more. This guide will walk you through the steps to install and configure Webmin on Ubuntu 22.04. This guide assumes you have root access.
Step 1: Deploying a Cloud Instance on Shape.host
- Log in to Shape.host Dashboard:
- Navigate to the Shape.host website and log in to your account.
- Create a New Instance:
- Click on the “Create” button located at the top right corner of the dashboard.
- From the dropdown menu, select “Instances”.
- Select Instance Location:
- Choose the desired location for your server. For this tutorial, we’ll select “New York, USA”.
- Choose a Plan:
- Select a plan that fits your requirements. For example, you might choose a plan with 2 cores CPU, 2 GB Memory, and 50 GB SSD disk space.
- Select an Operating System:
- Scroll down to the “Choose an image” section and select “Ubuntu 22.04”.
- Configure Additional Options:
- (Optional) You can configure additional options like User Data Configuration and IPv6 Networking.
- Enter a hostname for your instance, e.g., “Tutorial Ubuntu”.
- Click on the “Create instance” button to deploy the instance.
Step 2: Connecting to Your Instance
- Retrieve SSH Credentials:
- Note the IP address of your newly created instance from the Shape.host dashboard.
- Connect via SSH:
- Open a terminal on your local machine.
- Use the following command to connect to your instance:
ssh root@your_instance_ip
- Replace
your_instance_ip
with the actual IP address of your instance.
Before you begin, ensure that you have:
- An Ubuntu 22.04 server instance
- Root access to the server
Step 3: Update Your System
First, ensure that your system is up to date. Open your terminal and run the following command:
apt update && apt upgrade -y
This command updates the package index and upgrades any outdated packages on your system.
Step 4: Install Required Dependencies
Webmin requires some additional packages to be installed. Install them by running:
apt install software-properties-common apt-transport-https wget -y
These packages help manage software properties, transport over HTTP, and download files from the web.
Step 5: Add the Webmin Repository
Next, add the Webmin repository to your system’s software repository list. Start by importing the Webmin GPG key:
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh
Step 6: Install Webmin
With the repository added, you need to update the package list again:
apt update
Now, you can install Webmin:
apt install webmin -y
This command will install Webmin and all necessary dependencies.
Step 7: Install Apache2
If you do not have a web server already installed, it’s recommended to install Apache2. This will ensure that Webmin can integrate smoothly with your server’s web services.
Install Apache2
apt install apache2 -y
Start and enable Apache2 to run on boot:
systemctl start apache2
systemctl enable apache2
Verify that Apache2 is running:
systemctl status apache2
Step 8: Configure the Firewall
If you have a firewall running, you need to allow Webmin through it. By default, Webmin listens on port 10000. Allow this port using the following command:
ufw allow 10000
Additionally, allow HTTP (port 80) and HTTPS (port 443) traffic:
ufw allow 80
ufw allow 443
ufw reload
ufw allow ssh
You can verify that the rules were added successfully by running:
ufw status
You should see entries allowing traffic on ports 80, 443, and 10000.
Step 9: Access Webmin
Webmin should now be installed and running on your server. To access it, open your web browser and navigate to:
https://your_server_ip:10000
Replace your_server_ip
with the actual IP address of your server.
You will see a warning about an insecure connection. This is because Webmin uses a self-signed SSL certificate by default. You can safely ignore this warning for now and proceed to the login page.
Step 10: Log In to Webmin
On the Webmin login page, enter your root username and password to log in. If you’re using a different administrative user, use that username and password instead.
Step 11: Secure Webmin
Although Webmin is now accessible, it’s a good practice to secure your installation. You can do this by setting up an SSL certificate from a trusted certificate authority or using Let’s Encrypt.
Example: Using Let’s Encrypt
First, install Certbot, the tool for obtaining Let’s Encrypt SSL certificates:
apt install certbot python3-certbot-apache -y
Then, generate the SSL certificate for your domain:
certbot --apache -d tutorials.shape.host
Follow the prompts to complete the setup. Certbot will automatically configure your Apache to use the new SSL certificate.
Configure Webmin to Use Let’s Encrypt Certificate
To configure Webmin to use the Let’s Encrypt SSL certificate, open the Webmin configuration file:
nano /etc/webmin/miniserv.conf
Update the keyfile
and certfile
lines to point to the Let’s Encrypt certificate:
ssl=1
keyfile=/etc/letsencrypt/live/tutorials.shape.host/privkey.pem
certfile=/etc/letsencrypt/live/tutorials.shape.host/fullchain.pem
Restart Webmin to apply the changes:
systemctl restart webmin
Troubleshooting SSL Issues
If Certbot fails to verify your domain, ensure that:
- The DNS settings for
tutorials.shape.host
point to your server’s IP address. - Your firewall allows traffic on ports 80 and 443.
- No other web server (like Apache or Nginx) is blocking the verification process.
Check the Certbot logs for more details:
less /var/log/letsencrypt/letsencrypt.log
By following these steps, you have successfully installed and configured Webmin on your Ubuntu 22.04 server. Webmin provides a powerful and user-friendly interface to manage your server, making administration tasks much easier.
If you’re looking for a robust hosting solution, consider Shape.host services. Shape.host offers a range of Cloud VPS hosting plans designed to provide high performance, scalability, and reliability for your web projects. Visit Shape.host to learn more about their services and find the perfect plan for your needs.