Rocky and Alma Linux setup are almost the same and so is the configuration. Here in this guide, we will do some initial Rocky or Alma Linux server setup that will add a solid foundation as well as it will also add a good layer of security. Although Ubuntu is not a bad choice. Ubuntu also offers good stability as well as latest applications. So, with Ubuntu you will always have the latest stack installed on your server. You can follow this initial Ubuntu server setup guide if you are going to use Ubuntu for your server.
Alma and Rocky Linux are enterprise grade operating system and thus they get updated packages only after thorough testing. This mechanism makes Alma and Rocky Linux very stable and have lesser number of bugs.
If you have a website that needs a highly stable and bug free environment, then i would suggest you to stick with Alma or Rocky Linux, else you can go ahead with Ubuntu. To boost performance, you can configure Redis and FastCGI cache on your server.

Prerequisite
- You must have a Rocky or Alma Linux server installed
- Root user and password ready
Step 1 – Login as root
1. Open the “putty” SSH tool, and enter your “server’s public IP address” in the Host Name field. Enter “22” in port and click on “Open“.
2. If it shows you any kind of warning, click on “accept”.
3. Enter “root” in place of username and hit “Enter”
4. Enter the “password” and hit “Enter“
Step 2 – Creating a new user
The first thing that we will do is, we will create a user so that we can perform further actions.
$ adduser ashish
Step 3 – Assigning “sudo” privileges to the new user
Execute the below command to create a new user “ashish”
$ usermod -aG wheel ashish
1. Set password for new user
$ passwd ashish
Note: Enter the password of your choice. Make sure to enter a strong password.
Step 3 – Installing and setting up firewall
Rocky and Alma Linux works best with “Firewalld” as the firewall. Hence, we will install the same for our setup
$ dnf install firewalld -y
The above command will install Firewalld on your server.
Step 4 – Start, enable and setup firewall
Execute the following commands to start and enable the firewall
$ systemctl start firewalld
$ systemctl enable firewalld
“OpenSSH” is enabled by default in the firewall so we will add “http” and “https” in the firewall so that our server can accept on both “http” and “https” requests.
Step 5 – Allow http and https in firewall
Execute the given below commands one by one to allow http and https through the firewall
$ firewall-cmd --permanent --add-service=http
$ firewall-cmd --permanent --add-service=https
Reload the firewall to apply new rules
$ firewall-cmd --reload
That’s it, you have your server with a solid foundation.
Leave a Reply