Managing and administering Linux servers can be a daunting task, especially for beginner Linux users. Fortunately, Webmin provides a user-friendly web-based interface that simplifies server management. With Webmin, you can easily create user accounts, set up Apache, DNS, and FTP servers, configure firewalls, share files, and much more. In this article, we will guide you through the process of installing Webmin on Debian 12, ensuring that you have all the necessary steps to get started.
Prerequisites
Before we begin, make sure you have the following prerequisites:
- A server running Debian 12
- A configured root password on the server
Getting Started
To start the installation process, it is recommended to update your system’s package cache to ensure you have the latest versions of all packages. Open your terminal and run the following command:
apt update -y
Once the package cache is updated, you need to install some required dependencies. Use the following command to install gnupg2
and curl
:
apt install gnupg2 curl -y
These dependencies are essential for the proper functioning of Webmin.
Install Webmin
By default, the Webmin package is not included in the Debian 12 default repository. Therefore, you need to add the Webmin repository to the APT package manager. To do this, follow these steps:
- Change to the
/tmp
directory:
cd /tmp
- Download and add the GPG key, and add the Webmin repository by executing the following commands:
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh
This will add the Webmin repository to your system.
- Update the repository and install Webmin using the following commands:
apt update -y apt install webmin --install-recommends -y
After the installation process completes, you can proceed to the next step.
Manage Webmin Service
Now that Webmin is installed, you can easily manage its service. The following commands will help you start, stop, restart, and check the status of the Webmin service.
To start the Webmin service, use the command:
service webmin start
To restart the Webmin service, execute:
service webmin restart
To stop the Webmin service, use the command:
service webmin stop
To check the status of the Webmin service, run the following command:
service webmin status
By default, Webmin listens on port 10000. You can verify this by executing the following command:
ss -antpl | grep10000
If everything is set up correctly, you should see the following output:
LISTEN 0 4096 0.0.0.0:10000 0.0.0.0:* users:(("miniserv.pl",pid=4073,fd=5))
This indicates that Webmin is running and ready to be accessed.
Configure Firewall for Webmin
To secure your server, it is recommended to configure a firewall. In this case, we will use UFW (Uncomplicated Firewall) to control the incoming and outgoing network traffic. Follow these steps to configure UFW for Webmin:
- Install UFW using the following command:
apt install ufw -y
- Allow incoming connections on ports 22 and 10000 by executing the commands:
ufw allow 22 ufw allow 10000
- Enable UFW by running the command:
ufw enable
- Verify the firewall configuration with the command:
ufw status
You should see the following output:
Status: active To Action From -- ------ ---- 22 ALLOW Anywhere 10000 ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) 10000 (v6) ALLOW Anywhere (v6)
This confirms that the firewall is configured to allow incoming connections on ports 22 and 10000.
How to Use Webmin
Now that Webmin is installed and properly configured, you can access it using any web browser. Follow these steps to get started:
- Open your web browser and enter the following URL:
https://your-server-ip:10000
Replace your-server-ip
with the actual IP address of your server.
- You will be redirected to the Webmin login page. Enter your root username and password, then click on the “Sign in” button.
- Once logged in, you will be greeted with the Webmin dashboard. From here, you can access various tools and modules to manage your Linux server.
Let’s explore some of the key features of Webmin:
Command Shell
Webmin provides a convenient command shell, allowing you to execute commands directly from the web interface. To access the command shell, click on “Tools” in the left pane, then select “Command Shell”. This will open a Linux terminal within Webmin, enabling you to run commands on your server.
File Manager
The File Manager in Webmin allows you to navigate and manage your server’s file system. To access the File Manager, click on “Tools” in the left pane, then select “File Manager”. From here, you can create files and directories, edit existing files, and perform various file operations.
Upload and Download
Webmin also provides a convenient file upload and download feature. To access this feature, click on “Tools” in the left pane, then select “Upload and Download”. This will allow you to transfer files to and from your server using the web interface.
Linux Firewall
Managing your server’s firewall is made easy with Webmin. To access the firewall interface, click on “Networking” in the left pane, then select “Linux Firewall”. From here, you can open or close specific ports to control network access for remote users.
Network Configuration
Webmin provides a network configuration wizard to simplify the process of setting up network interfaces on your server. To access the network configuration wizard, click on “Networking” in the left pane, then select “Network Configuration”. From here, you can configure static IP addresses, default gateways, hostnames, and DNS settings.
Partitions and Local Disks
Managing your server’s hard disk partitions is crucial for efficient storage management. Webmin offers a Partition Manager that allows you to create, edit, and manage partitions on your local disks. To access the Partition Manager, click on “Hardware” in the left pane, then select “Partitions and Local Disks”.
Removing Webmin
If, for any reason, you decide to remove Webmin from your Debian 12 server, follow these steps:
- Open your terminal and run the following command to remove Webmin:
apt remove webmin
- Clean the package cache and remove any unwanted packages by executing the following command:
apt autoremove -y
apt clean
By following these steps, you will successfully remove Webmin from your server.
Conclusion
Congratulations! You have successfully installed Webmin on your Debian 12 server. Webmin provides a powerful and user-friendly interface for managing and controlling your Linux server with ease. Whether you need to configure services, manage files, or secure your server, Webmin offers a comprehensive set of tools to streamline your server administration tasks. If you have any questions or need further assistance, feel free to reach out to us. Shape.host is committed to providing efficient, scalable, and secure cloud hosting solutions, including SSD Linux VPS, to empower businesses in their digital journey.