Debian 11 Initial server setup on Cloud VPS server [Video]

Last updated on December 18th, 2022 at 11:17 am.

Contabo VPS setup Debian 11 - Debian Initial server setup full video

Note : Contabo VPS setup Debian 11 – Debian Initial server setup full video . Yes in this video I used Contabo, however you can use any VPS provider of your choice.

Watch the video above to set up your Debian 11 server.

All the commands used in this video are the same ones used in the Ubuntu 22.04 set up post.

To follow along, use the post about setting up Ubuntu 22.04 here. The post below was added to increase content count for this page.

To deploy a Debian 11 Vultr server on Vultr:

  1. Go to the Vultr website and create an account if you don’t already have one.
  2. Once you are logged in, click on the “Deploy” button on the top menu.
  3. Select “Debian 11” from the list of available operating systems.
  4. Choose the location and the type of server you want to deploy.
  5. Select the server size and the plan that suits your needs.
  6. Click on the “Deploy Now” button to deploy the server.

To deploy a Debian 11 server on Linode, you will need to follow these steps:

  1. Sign up for an account on the Linode website and create a new server, or “Linode,” in their control panel.
  2. Choose Debian 11 as the distribution for your server.
  3. Choose a plan and a region for your server.
  4. Give your server a label and a root password.
  5. Click the “Create” button to create your server.

To deploy a Debian 11 server on DigitalOcean, you will need to follow these steps:

  1. Go to DigitalOcean’s website and create an account if you don’t already have one.
  2. Log in to your DigitalOcean account and click the “Create” button in the top right corner of the dashboard.
  3. Select “Droplets” from the list of options.
  4. Choose Debian 11 from the list of available operating systems.
  5. Select the desired size and region for your server.
  6. Choose a hostname for your server.
  7. Click the “Create Droplet” button to create your server.

After your server is created, you will be presented with the server’s dashboard, which shows its IP address and other information. You can then use an SSH client to connect to the server using the root password you provided.

To log in via SSH:

  1. Once the server has been deployed, you will see the login information on the server page.
  2. Open a terminal window on your local computer and type the following command:
ssh user@server_ip_address
  1. Replace “user” with the username of the user you created on the server, and “server_ip_address” with the actual IP address of your server.
  2. Press Enter and you will be prompted to enter the password for the user.
  3. Type in the password and press Enter. You should now be logged in to the server via SSH.

To create a user and add the user to the sudoers group:

  1. Log in to the server via SSH as the root user.
  2. Type the following command to add a new user:
adduser username
  1. Replace “username” with the desired username.
  2. Follow the prompts to set the password and other information for the user.
  3. To add the user to the sudoers group, type the following command:
usermod -aG sudo username
  1. Replace “username” with the actual username of the user you just created.

Edit the SSH configuration file by typing the following command:

nano /etc/ssh/sshd_config
  1. Find the line that says “PasswordAuthentication” and set its value to “no”.
  2. Find the line that says “PermitRootLogin” and set its value to “no”.
  3. Save the file and restart the SSH service by typing the following command:
systemctl restart ssh

You can now log in to the server using the private key from your local computer.

Please note that these steps are just a summary of the process. Use the post here to set up your Debian server on a VPS.

To disable root login and password authentication:

  1. Log in to the server via SSH as a user with sudo privileges.
  2. Edit the SSH configuration file by typing the following command:
sudo nano /etc/ssh/sshd_config
  1. Find the line that says “PasswordAuthentication” and set its value to “no”.
  2. Find the line that says “PermitRootLogin” and set its value to “no”.
  3. Save the file and restart the SSH service by typing the following command:
sudo systemctl restart ssh

To set up a firewall:

  1. Install the ufw firewall by typing the following command:
sudo apt-get install ufw
  1. Allow SSH connections by typing the following command:
sudo ufw allow ssh
  1. Allow HTTP and HTTPS connections by typing the following command:
sudo ufw allow http
sudo ufw allow https
  1. Enable the firewall by typing the following command:
sudo ufw enable

To change the SSH port:

  1. Log in to the server via SSH as a user with sudo privileges.
  2. Edit the SSH configuration file by typing the following command:
sudo nano /etc/ssh/sshd_config
  1. Find the line that says “Port” and change it to the desired port number.
  2. Save the file and restart the SSH service by typing the following command:
sudo systemctl restart ssh
  1. If you are connecting to the server from a remote location, you will need to specify the new port number when connecting via SSH. For example:
ssh user@server_ip_address -p port_number

To create a swap file:

  1. Log in to the server via SSH as a user with sudo privileges.
  2. Check the available disk space by typing the following command:
df -h
  1. Create a file for the swap space with the following command:
sudo fallocate -l size_of_swap_file /swapfile
  1. Replace “size_of_swap_file” with the desired size of the swap file, for example “2G” for 2 GB.
  2. Set the correct permissions on the swap file with the following command:
sudo chmod 600 /swapfile
  1. Mark the file as swap space with the following command:
sudo mkswap /swapfile
  1. Enable the swap file by typing the following command:
sudo swapon /swapfile
  1. To make the swap file permanent, add the following line to the “/etc/fstab” file:
/swapfile none swap sw 0 0
  1. Save the file and exit.

o change the server hostname:

  1. Log in to the server via SSH as a user with sudo privileges.
  2. Edit the hostname configuration file by typing the following command:
sudo nano /etc/hostname
  1. Replace the current hostname with the desired hostname and save the file.
  2. Edit the hosts file by typing the following command:
sudo nano /etc/hosts
  1. Replace the current hostname with the desired hostname in the file and save it.
  2. Reboot the server for the changes to take effect by typing the following command:
sudo reboot

To set the timezone:

  1. Log in to the server via SSH as a user with sudo privileges.
  2. List the available timezones by typing the following command:
timedatectl list-timezones
  1. Set the timezone by typing the following command:
sudo timedatectl set-timezone timezone
  1. Replace “timezone” with the desired timezone, for example “Europe/London” or “America/New York”.

To set up automatic updates:

  1. Log in to the server via SSH as a user with sudo privileges.
  2. Install the “unattended-upgrades” package by typing the following command:
sudo apt-get install unattended-upgrades
  1. Edit the configuration file by typing the following command:
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
  1. Find the line that says “Unattended-Upgrade::Mail” and set it to “root” to receive email notifications about the updates.
  2. Find the line that says “Unattended-Upgrade::Automatic-Reboot” and set it to “true” if you want the server to automatically reboot after the updates are installed.
  3. Save the file and exit.


Discover more from Bizanosa

Subscribe to get the latest posts sent to your email.

Comment Here

Join this free course:

How to host multiple WordPress
websites on a VPS

Close me!