Once you have used the OVH Dashboard to set up your “Ubuntu Server 22.04 LTS “Jammy Jellyfish”” used in this instance, it’s time to login, set up your username and password, and then sort your applications out, ready to get your server exactly how you want it.
In this step by step guide, we will :-
- Check for updates and ensure we ready
- Login and Change Username and Password
- Delete the default “Ubuntu/root” user
- Point a domain to the server (required for SSL)
- Enable Firewall
- Install Apache Web Server (required for SSL)
- Install an SSL Certificate
- Install Webmin for remote http management
- Install an application to run at startup
Step 1: Log in via SSH
Open your terminal and log in to your server
ssh username@server_ip
Accept the SSH key if prompted Enter your password when prompted
Step 2: Create a New User and Set Password
Create a new user in this case named NEWUSERHERE (but choose your own of course!)
sudo adduser NEWUSERHERE
Set a password for NEWUSERHERE Follow the prompts to enter and confirm the password
Grant sudo privileges to the new user
sudo usermod -aG sudo NEWUSERHERE
Switch to the new user
su - NEWUSERHERE
Remove the default ‘ubuntu’ user after verifying NEWUSERHERE works correctly
sudo deluser --remove-home ubuntu
Step 3: Point Your Domain to the Server
Login to your domain registrar’s control panel and update the DNS A record to point to your server’s IP.
Use a tool like DNSChecker to verify DNS propagation.
Step 4: Install and Configure UFW Firewall
Install UFW
sudo apt update
sudo apt install ufw -y
Set default policies to deny incoming connections and allow outgoing connections
sudo ufw default deny incoming
sudo ufw default allow outgoing
Allow SSH connections
sudo ufw allow OpenSSH
Enable the firewall
sudo ufw enable
Check UFW status
sudo ufw status
Step 5: Install Apache
Install Apache web server
sudo apt install apache2 -y
Verify Apache installation
sudo systemctl status apache2
Allow Apache through the firewall
sudo ufw allow 'Apache Full'
Step 6: Install a Free SSL Certificate Using Certbot
Install Certbot with Apache plugin
sudo apt install certbot python3-certbot-apache -y
Obtain the SSL certificate for YOURDOMAINHERE
sudo certbot --apache -d YOURDOMAINHERE
Verify automatic renewal
sudo certbot renew --dry-run
Restart Apache to apply SSL configuration
sudo systemctl restart apache2
Step 7: Install and Configure Webmin with SSL
Add Webmin repository
sudo sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list'
wget -qO - http://www.webmin.com/jcameron-key.asc | sudo apt-key add -
Install Webmin
sudo apt update sudo apt install webmin -y
Configure Webmin to use SSL
sudo nano /etc/webmin/miniserv.conf
In the file, ensure these lines are present:
ssl=1
ssl_cipher_list=HIGH:!aNULL:!MD5:!3DES
ssl_honorcipherorder=1 # ssl_version=TLSv1_2 TLSv1_3
Set correct permissions for SSL certificate files
sudo chown root:root /etc/letsencrypt/live/YOURDOMAINHERE/privkey.pem
sudo chown root:root /etc/letsencrypt/live/YOURDOMAINHERE/fullchain.pem
sudo chmod 600 /etc/letsencrypt/live/YOURDOMAINHERE/privkey.pem
sudo chmod 600 /etc/letsencrypt/live/YOURDOMAINHERE/fullchain.pem
Allow Webmin through the firewall
sudo ufw allow 10000/tcp
Restart Webmin
sudo systemctl restart webmin
Access Webmin via https://YOURDOMAINHERE:10000
Step 8: Configure the 4×6 TB HDD SATA Drives via Terminal
We have 4 6tb drives installed as well as the 512gb SSD so we need to :
List all connected drives
sudo lsblk
Partition the drives (if necessary)
sudo fdisk /dev/sdb
Follow prompts to create a new partition, then do the same for /dev/sdc, /dev/sdd, /dev/sde (or whatever it tells you the drives are)
Format the drives with ext4 filesystem (again, our drives are sdb1, sdc1, sdd1 and sde1 , yours may be different)
sudo mkfs.ext4 /dev/sdb1
sudo mkfs.ext4 /dev/sdc1
sudo mkfs.ext4 /dev/sdd1
sudo mkfs.ext4 /dev/sde1
Create mount points
sudo mkdir -p /mnt/data1
sudo mkdir -p /mnt/data2
sudo mkdir -p /mnt/data3
sudo mkdir -p /mnt/data4
Mount the drives to the directories
sudo mount /dev/sdb1 /mnt/data1
sudo mount /dev/sdc1 /mnt/data2
sudo mount /dev/sdd1 /mnt/data3
sudo mount /dev/sde1 /mnt/data4
Update /etc/fstab to ensure mounts persist after reboot
sudo nano /etc/fstab
Add these lines to the file:
/dev/sdb1 /mnt/data1 ext4 defaults 0 2
/dev/sdc1 /mnt/data2 ext4 defaults 0 2
/dev/sdd1 /mnt/data3 ext4 defaults 0 2
/dev/sde1 /mnt/data4 ext4 defaults 0 2
Verify the mounts
sudo mount -a df -h
Step 9: Install and Configure Your Other Apps
Now install your other apps as required. (See instruction from app supplier for how to)
Step 10: Ensure Everything is Up-to-Date
Update the System
sudo apt update
sudo apt upgrade -y
Reboot the Server to apply updates
sudo reboot
