How To Set Up an Ubuntu Server on a DigitalOcean Droplet

Setting up an Ubuntu Server on a DigitalOcean Droplet is a common task for deploying web applications, hosting websites, running databases, and more. Here's a detailed guide to help you through the process:

  1. Sign Up/Login to DigitalOcean

    If you haven't already, sign up for a DigitalOcean account. If you have an account, log in to the DigitalOcean dashboard.

  2. Create a Droplet:
    • Click on the "Create" button and select "Droplets" from the dropdown menu.
    • Choose an image: Select "Ubuntu" as the operating system. You can choose the version you prefer, such as Ubuntu 20.04 LTS.
    • Choose a plan: DigitalOcean offers various plans with different resources. Choose the plan that suits your needs.
    • Choose a datacenter region: Select the region closest to your target audience or where you want your server to be located.
    • Choose additional options if needed, such as backups, monitoring, IPv6, user data, etc.
    • Add your SSH keys: If you have an SSH key pair, you can add your public key to the droplet for secure SSH access. If not, you can use a password to log in (though SSH keys are highly recommended for security).
    • Choose a hostname for your droplet to easily identify it.
    • Click on "Create Droplet" to provision your Ubuntu server.
  3. Access Your Droplet:

    Once the droplet is created, you'll receive an email with the IP address of your droplet and the root password if you didn't add SSH keys. You can use this information to access your server via SSH.If you're on Linux or macOS, open a terminal and use the following command:

                    
                        ssh root@your_droplet_ip
                    
                

    If you're on Windows, you can use a tool like PuTTY to SSH into your droplet.

  4. Initial Server Setup:

    After logging in to your droplet, it's a good practice to perform some initial setup tasks:

    • Update the package index and upgrade installed packages:

                              
                                  sudo apt update
                                  sudo apt upgrade                            
                              
                          

    • (Optional) Create a new user and add it to the sudo group for better security:

                              
                                  (Optional) Create a new user and add it to the sudo group for better security:
                              
                          

    • (Optional) Disable root login over SSH for enhanced security:

                              
                                  sudo nano /etc/ssh/sshd_config
                              
                          

      Find the line PermitRootLogin yes and change it to PermitRootLogin no. Save the file and restart the SSH service:

                              
                                  sudo systemctl restart ssh
                              
                          

  5. Firewall Configuration (Optional but Recommended):

    Configure the firewall to allow only necessary connections. For example, if you're running a web server, allow HTTP (port 80) and HTTPS (port 443) traffic:

                    
                        sudo ufw allow OpenSSH
                        sudo ufw allow 80/tcp
                        sudo ufw allow 443/tcp
                        sudo ufw enable                    
                    
                

  6. Install Additional Software:

    Depending on your requirements, you may need to install additional software. For example, if you're setting up a web server, you'll need to install a web server software like Apache or Nginx. If you're setting up a database server, you'll need to install a database server like MySQL or PostgreSQL.

That's it! You've now successfully set up an Ubuntu Server on a DigitalOcean Droplet. You can proceed to configure and install any necessary software based on your specific use case.

Secure Remote Access to DigitalOcean with Netmaker

Securing remote access to your DigitalOcean droplet with Netmaker can significantly enhance the security and management of your network. Netmaker is an open-source network management solution that allows you to create secure, scalable, and high-perfo …

read more

Video Streaming on Premium CPU-Optimized Droplets

Setting up video streaming on DigitalOcean’s premium CPU-optimized droplets can offer high performance for encoding, streaming, and handling multiple simultaneous connections. Below is a step-by-step guide to deploy a video streaming server usi …

read more