Welcome to eServers! You've just provisioned a new dedicated server, giving you a powerful, single-tenant environment with full control over all resources.
Setting up a new server can seem complex, but this guide breaks it down into 7 essential steps. We'll cover everything from the initial secure login and firewall configuration to installing your software and setting up monitoring.
Let's get your server ready for production.
Step 1 — Initial Server Access (Logging in as Root)
Your first action is to connect to your server as the root user. You will have received your server’s public IP address and root password in your eServers welcome email.
Connect via SSH
From your local computer's terminal (macOS/Linux) or an SSH client like
PuTTY (Windows), use the following command. Replace your_server_ip with your
server's actual IP address.
ssh root@your_server_ip
Host Authenticity Warning
The first time you connect, you will likely see a warning about the host's authenticity. This is normal.
The authenticity of host 'your_server_ip' can't be established.
Type yes and press ENTER to continue. You will then be
prompted for the root password.
About the Root Account
The root user has complete and unrestricted privileges,
which is dangerous for regular use. A single typo can be destructive. Our next step is to
create a limited user account for daily operations.
Step 2 — Create a Sudo User & Harden SSH
We will now create a new, non-root user and grant it administrative
privileges using sudo. This allows you to run commands as root when needed
without logging in as root.
1. Create the New User
While logged in as root, run this command (replace sammy
with your desired username):
# adduser sammy
You will be prompted to create a strong password and fill in some optional user information (you can press ENTER to skip these).
2. Grant Administrative (Sudo) Privileges
Next, add your new user to the group that grants sudo
permissions. This group's name differs depending on your server's operating system.
For Ubuntu or Debian:
# usermod -aG sudo sammy
For AlmaLinux, Rocky Linux, or CentOS:
# usermod -aG wheel sammy
3. (Recommended) Harden SSH
For enhanced security, you should use SSH keys instead of passwords and disable root login entirely.
- First,set up SSH keys for your new
sammyuser. - Once you have confirmed you can log in as
sammywith your SSH key, edit the SSH config file:sudo nano /etc/ssh/sshd_config - Change
PermitRootLogin yestoPermitRootLogin no. - Change
PasswordAuthentication yestoPasswordAuthentication no. - Restart the SSH service:
sudo systemctl restart sshd
From this point on, log out of your root session and log back in as
your new user: ssh sammy@your_server_ip
Step 3 — System Updates & Firewall Configuration
Now logged in as your new sudo user, your first tasks are to update all system packages and enable a firewall.
1. Update System Packages
This ensures all your software is up-to-date with the latest security patches.
For Ubuntu or Debian:
$ sudo apt update && sudo apt upgrade -y
For AlmaLinux, Rocky Linux, or CentOS:
$ sudo dnf update -y
2. Configure Your Firewall
A firewall is critical for blocking unauthorized access. We will only allow SSH (so you don't get locked out) and enable the firewall.
For Ubuntu/Debian (using UFW - Uncomplicated Firewall):
$ sudo ufw allow OpenSSH
$ sudo ufw enable
Type y to confirm. You can check the status with
sudo ufw status.
For AlmaLinux/Rocky/CentOS (using firewalld):
$ sudo firewall-cmd --permanent --add-service=ssh
$ sudo firewall-cmd --reload
You can check the active rules with
sudo firewall-cmd --list-all.
Step 4 — Install & Configure Essential Software
Your server is now secure. It's time to install the software that fulfills its purpose (e.g., web server, database server, game server).
A common setup is a LAMP (Linux, Apache, MySQL, PHP) stack for hosting websites. Here’s how to install it.
1. Install LAMP Stack
For Ubuntu or Debian:
$ sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql -y
For AlmaLinux, Rocky Linux, or CentOS:
$ sudo dnf install httpd mariadb-server php php-mysqlnd -y
$ sudo systemctl enable --now httpd
$ sudo systemctl enable --now mariadb
2. Update Firewall for Web Traffic
Now you must allow HTTP (port 80) and HTTPS (port 443) traffic through your firewall.
For UFW (Ubuntu/Debian)
$ sudo ufw allow 'Apache Full
For firewalld (AlmaLinux/Rocky):
$ sudo firewall-cmd --permanent --add-service=https
$ sudo firewall-cmd --reload
Step 5 — (Optional) Domain and DNS Setup
To connect a domain name (e.g., example.com) to your server,
you must update your DNS records. This is done at your domain
registrar (the company where you bought your domain).
-
Log in to your domain registrar's control panel.
-
Navigate to the DNS Management or DNS Editor for your domain.
-
Create or edit the 'A' record for your root domain (often represented by
@) to point to your server's IP address.
Example 'A' Record:
- Type:
A - Host/Name:
@ - Value/Points To:
your_server_ip - TTL:
3600(or default)
You may also want to create a CNAME record for www
pointing to @, or a separate 'A' record for www.
Note: DNS changes can take several hours to propagate
globally.
Step 6 — Set Up Monitoring and Backups
A server is only reliable if it's monitored and backed up.
Monitoring
It's crucial to watch your server's resource usage (CPU, RAM, Disk). While eServers provides basic monitoring in your client panel, you can use real-time in-terminal tools.
A popular, easy-to-read tool is htop.
For Ubuntu/Debian
$ sudo apt install htop
For AlmaLinux/Rocky
$ sudo dnf install htop
Simply type htop to run it. For more comprehensive, long-term
monitoring, consider setting up a tool like Netdata or Prometheus.
Backups
Data loss is not a question of *if*, but *when*. A server without a backup strategy is a liability. Hardware can fail, and mistakes can happen.
eServers offers robust, automated server backup solutions that can be easily added
to your account. We strongly recommend this to protect your data. Alternatively, you can
configure your own solution using tools like rsync to an off-site storage
location.
Step 7 — Testing and Deployment
Your server is now fully configured and ready for your application. The final step is to deploy your website files or application code.
For a LAMP stack, your website files should be placed in the web root
directory, which is typically /var/www/html.
You can securely transfer files from your local machine to the server
using scp (Secure Copy) or by using git to pull your code from a
repository.
Example using scp to upload a website:
$ scp -r /local/path/to/my-website/* sammy@your_server_ip:/var/www/html/
After uploading your files, be sure to set the correct permissions so the web server can read them
$ sudo chown -R www-data:www-data /var/www/html
$ sudo find /var/www/html -type d -exec chmod 755 {} \;
$ sudo find /var/www/html -type f -exec chmod 644 {} \;
Once deployed, test your website thoroughly in your browser to ensure all functionality is working as expected.
Conclusion: Your Server is Live!
Congratulations! You have successfully completed the 7 essential steps to set up your new dedicated server.
You've gone from a fresh OS install to a fully secured, updated, and
configured server ready for production traffic. You've secured access with a sudo
user, locked down ports with a firewall, installed your core software stack, pointed your
domain, and considered monitoring and backups.
At eServers, we provide the high-performance infrastructure and expert support to help you succeed. If you have any questions, need help with advanced configurations, or want to add managed backup services, get in touch with our team today. We're here for you 24/7.
Discover eServers Dedicated Server Locations
eServers provides reliable dedicated servers across multiple global regions. Whether you need low latency, regional compliance, or proximity to your audience, our wide geographic coverage ensures the perfect hosting environment for your project.