Initial Server Setup with Ubuntu 20.04

Initial Server Setup with Ubuntu 20.04

Updated on August 9, 2021 • Tutorial


Introduction

When you first create a new Ubuntu 20.04 server, you should perform some important configuration steps as part of the initial setup. These steps will increase the security and usability of your server, and will give you a solid foundation for subsequent actions.

1

Logging in as root

To log into your server, you will need to know your server’s public IP address. Connect via SSH:

ssh root@your_server_ip
2

Creating a New User

Create a non-root user for daily administration:

adduser sammy
3

Granting Administrative Privileges

Add the user to the sudo group:

usermod -aG sudo sammy
4

Setting Up a Basic Firewall

Configure UFW firewall:

ufw app list
ufw allow OpenSSH
ufw enable
ufw status
5

Enabling External Access

If using SSH keys, copy them to the new user:

rsync --archive --chown=sammy:sammy ~/.ssh /home/sammy

Conclusion

Your server is now configured with a secure foundation: non-root sudo user, UFW firewall with SSH enabled, and secure authentication.