![ubuntu setup](https://greenhost.cloud/wp-content/uploads/2024/07/2150010144.jpg)
Setting up a new server can be a daunting task, especially if you are new to server administration. But fear not, with the right guidance and a bit of patience, you can have your Ubuntu 24 server up and running in no time.
In this blog post, we will walk you through the initial server setup process for Ubuntu 24. We will cover everything from creating a new user to setting up a firewall, ensuring that your server is secure and ready to handle your workloads.
Step 1: Connect to your server
Once you have launched your Ubuntu 24 server, the first step is to connect to it. You can do this using an SSH client like PuTTY or the terminal on a Linux machine. Use the IP address provided by your hosting provider and the username and password for your server to log in.
Step 2: Create a new user
It is not recommended to use the root user for everyday tasks, so the next step is to create a new user with sudo privileges. This user will have the ability to perform administrative tasks without being logged in as the root user.
To create a new user, use the following command:
sudo adduser newusername
Replace “newusername” with the desired username for the new user. Follow the prompts to set a password and any additional information for the user.
Step 3: Grant sudo privileges
Once the new user is created, you need to grant them sudo privileges. This will allow them to use the sudo command to perform administrative tasks. To grant sudo privileges, add the user to the sudo group using the following command:
sudo usermod -aG sudo newusername
Step 4: Update and install necessary packages
Before proceeding, it is essential to update the package list and install any necessary packages. Use the following commands to update the package list and install the necessary packages:
sudo apt update
sudo apt upgrade
Step 5: Configure firewall
A firewall is an essential security tool that helps protect your server from unauthorized access. Ubuntu 24 comes with the UFW (Uncomplicated Firewall) tool pre-installed. You can enable the firewall and allow SSH connections with the following commands:
sudo ufw enable
sudo ufw allow OpenSSH
Step 6: Enable automatic security updates
Keeping your server up to date is crucial for security reasons. Ubuntu 24 comes with the unattended-upgrades package pre-installed, which allows you to automatically install security updates. You can configure automatic security updates by installing the package and enabling it with the following commands:
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
With these steps, you have completed the initial server setup for your Ubuntu 24 server. Your server is now secure and ready to handle your workload. If you encounter any issues or need further assistance, don’t hesitate to reach out to your hosting provider.