Skip to main content

DigitalOcean: Install Ubuntu 24.04

Below is a comprehensive, step‐by‐step guide for performinglaunching aand cleanconfiguring installation ofan Ubuntu 24.04 asheadless server on DigitalOcean. This tutorial will walk you through creating a headlessDroplet, server.connecting Thisvia guideSSH, coversand everythingperforming from preparation tobasic post-installationdeployment configuration without a desktop environment. Note: A clean installation will erase existing data on the target drive. Be sure to back up any important data before proceeding.configuration.


1. Pre-InstallationCreate Preparationsa DigitalOcean Account (if you haven’t already)

a.
    Verify
  1. Sign SystemUp Requirements

/ Log In:
  • Processor:Visit 2DigitalOcean GHzand dual-corelog in or bettersign up for an account.
  • MemoryBilling (RAM):& Payment: Minimum 4 GB (more recommended for server workloads)
    • DiskMake Space: Minimum 20 GB (adjust based onsure your intendedbilling server usage)
    • Network: Ethernet or Wi-Fi adapter (wiredinformation is preferredset forup servers)
    • so
    • Consoleyou Access:can Eithercreate direct physical access or remote (via IPMI/KVM) since no GUI will be availableDroplets.

    b. Backup Your Data

    • Warning: A clean installation will erase all data on the chosen drive. Back up important files and configurations.

    2. DownloadCreate thea New Droplet with Ubuntu 24.04 Server ISO

    1. Visit the Official Ubuntu Website:
      Navigate to Droplets:

      • In the DigitalOcean control panel, click Create and select Droplets.
    2. Choose an Image:

    3. Select Ubuntua 24.04Plan:

      LTS:
      Click
        on
      • Choose the UbuntuDroplet 24.04size LTSthat Serverbest downloadfits button.

        your needs (e.g., Basic with 1-2 GB of RAM for lightweight tasks, or larger for production workloads).
    4. DownloadChoose a Datacenter Region:

      • Select the ISO:
        Saveregion the ISO fileclosest to your computer.

        target audience for better latency.
    5. Verify the Download (Optional but Recommended):Authentication:

      • OnSSH Linux/macOS:Keys (Recommended):
        sha256sum
          path/to/ubuntu-24.04-live-server-amd64.iso
      • Add your SSH public key to securely access the Droplet.
    6. OnPassword Windows:Authentication:
      Use
      • Alternatively, choose to use a toolstrong suchpassword as(less QuickHashsecure; tonot verifyrecommended theif checksumyou providedcan use SSH keys).
    7. Additional Options:

      • You may optionally enable backups, monitoring, and IPv6 if needed.
      • Tag your Droplet for easier organization.
    8. Finalize and Create:

      • Click Create Droplet.
      • After a few moments, your Droplet will be ready. You’ll see its public IP address on the UbuntuDigitalOcean website.dashboard.

    3. CreateConnect ato BootableYour USBDroplet Drivevia SSH

    a. Using Rufus (Windows)

    1. Download and Install Rufus:
      Visit rufus.ie and download the latest version.

    2. InsertOpen a USB Drive:
      Ensure it’s at least 2 GB (all data on the USB will be erased).

    3. Open Rufus and Configure:Terminal:

      • Device:On SelectLinux/macOS, open your USB drive.terminal.
      • BootOn selection:Windows, Clickuse “SELECT”an andSSH chooseclient like PuTTY or the Ubuntubuilt-in 24.04Windows Server ISO.
      • Partition scheme:
        • Choose GPT for UEFI systemsTerminal (most modern PCs).
        • Choose MBR if youusing need BIOS/Legacy support.
      • File System: Typically “FAT32” (default)OpenSSH).
    4. StartConnect to the Process:
      Click “START” and confirm any warnings. Rufus will now create your bootable USB drive.

    b. Using balenaEtcher (macOS/Linux/Windows)

    1. Download Etcher:
      Go to balenaEtcher and download the version for your OS.

    2. Install and Run Etcher:Droplet:

      • SelectRun the Ubuntufollowing 24.04command, Serverreplacing ISO.
      • username
      • Choose(usually root on first login) and <droplet_ip> with your USBDroplet’s drive.
      • IP
      • Click “Flash!” and wait for the process to finish.

    c. Using the dd Command (Linux/macOS)

    Warning: The dd command is powerful. Ensure you’ve selected the correct drive to avoid data loss.

    1. Identify the USB Drive:address:
      lsblkssh root@<droplet_ip>
    2. WriteIf theusing ISOan toSSH thekey, USB:
      Replace /dev/sdX withensure your USBkey deviceis loaded (do not include a partition number, e.g., useusing /dev/sdbssh-agent instead of /dev/sdb1):
      sudo dd if=/path/to/ubuntu-24.04-live-server-amd64.iso of=/dev/sdX bs=4M status=progress conv=fdatasync

    4. Booting from the USB Drive

    1. Insert the Bootable USB Drive into the server hardware.

    2. Restart Your Server.

    3. Enter BIOS/UEFI Settings:

      • Common keys: F2, F12, DEL, or specifying ESC-i path/to/your/key (refer to your hardware’s documentation)).
      • Set the boot order to prioritize booting from the USB drive.
    4. Save and Exit:
      Your server should now boot fromAccept the USB drive.Fingerprint:


    5. Starting the Ubuntu Server Installation

    1. Boot Menu:
      After booting from the USB, you’ll see a text-based installer menu. Since this is a server installation, there is no graphical “Try” mode.
      • When prompted, type Action:yes Selectto “Installcontinue Ubuntu Server” (or similar option) using your keyboard’s arrow keys and press Enter.connecting.

    6.4. Follow the Server Installation Wizard

    The installation wizard is text-based and will guide you through the setup. Use the keyboard (arrow keys, Tab, and Enter) to navigate the menus.

    a. Select Your Language

    • Screen: “Welcome to Ubuntu Server Installer”
    • Action: Choose your preferred language and press Enter.

    b. Select Your Keyboard Layout

    • Screen: “Keyboard Configuration”
    • Action: Choose your layout (often “English (US)” or your regional setting) and press Enter.

    c. Configure the Network

    • Screen: “Network Connections”
    • Action:
      • The installer will attempt to configure networking via DHCP.
      • If using a static IP or additional network interfaces, follow the prompts to set up manually.
      • Tip: Ensure your network connection is active so that installation can download updates and packages if needed.

    d. Configure the Proxy (If Applicable)

    • Screen: “HTTP Proxy”
    • Action: Enter your proxy settings if required, or leave blank if not using one.

    e. Choose a Mirror for Package Updates

    • Screen: “Ubuntu Archive Mirror”
    • Action: Select the appropriate mirror (usually detected automatically) and press Enter.

    f. Storage Configuration

    • Screen: “Partition Disks”
    • Options:
      • Guided – use entire disk: For a fully automatic partitioning scheme (this will erase all data).
      • Manual: For custom partitioning (for example, creating separate partitions for /, /var, or swap).
    • Action: Choose your preferred option, confirm any warnings, and proceed.
      • For UEFI systems, ensure an EFI System Partition (≈300–500 MB, FAT32) is created if not already present.
      • Set up the root partition (/) (at least 10–20 GB recommended).
      • Optionally configure a swap area (or use a swap file post-installation).

    g. Profile Setup

    • Screen: “Who Are You?”
    • Action:
      • Enter your full name, a username, and a secure password.
      • Configure whether to enable SSH access during installation (highly recommended for headless servers).
      • Tip: Many server installers offer to install and enable the OpenSSH server automatically—confirm this to allow remote management.

    h. Feature Selection (Optional)

    • Screen: “Featured Server Snaps” or “Additional Software”
    • Action:
      • You might have options to install services like LXD, Docker, or other server applications.
      • Select the ones you need, or skip if you plan to install them later.

    i. Finalize the Installation

    • Screen: “Summary”
    • Action: Review your configuration and confirm to begin installation.
    • The installer will now copy files and configure your system. This process may take several minutes.

    7. Finishing Up

    1. Installation Complete:
      Once the process is finished, you’ll be prompted to remove the installation media.

    2. Restart Your Server:

      • Remove the USB drive.
      • Press Enter to reboot.
    3. First Boot:

      • Your server will boot into a command-line login prompt.
      • Log in using the username and password you created during installation.

    8.Initial Post-Installation ConfigurationSetup

    Once connected, perform these basic steps to secure and update your server.

    a. Update theand SystemUpgrade Packages

    1. Log In via Console or SSH:
      If you enabled the SSH server, you can now connect remotely.
    2. Update Package ListsLists: and
      apt update
    3. Upgrade Packages:
      sudo apt update
      sudo apt upgrade -y
    4. Clean Up Unused Packages:
      sudo apt autoremove -y

    b. Create a Non-Root User (Optional but Recommended)

    1. Create a User:
      adduser yourusername
    2. Grant Sudo Privileges:
      usermod -aG sudo yourusername
    3. Test by Logging in as Your New User:
      • Log out of the root session:
        exit
      • Log in again using:
        ssh yourusername@<droplet_ip>

    c. Secure RemoteSSH Access

      1. Edit the SSH Configuration:
        The

        server
        sudo installernano should have set up SSH, but you can further harden it:
        
        • Edit /etc/ssh/sshd_config
        to
      2. disable
      3. Recommended Changes:

        • Disable root login and(if considernot changingneeded):
          PermitRootLogin no
        • (Optional) Change the default SSH port.port (e.g., to 2222):
          Port 2222
        • Save and exit the editor (in nano, press Ctrl+X, then Y, then Enter).
      4. Restart SSH:SSH Service:

        sudo systemctl restart ssh

    Note: If you change the SSH port, connect with:
    ssh -p 2222 yourusername@<droplet_ip>

  • d. Configure the UFW Firewall Setup with UFW:

    1. EnableAllow UFW:SSH Connections:
      sudo ufw allow ssh
      • If you changed your SSH port, use:
        sudo ufw allow 2222/tcp
    2. Enable UFW:
      sudo ufw enable
    3. Check Firewall Status:
      sudo ufw status verbose

  • c.

    5. Install Essential Server Packages

      Depending

    • Installon utilitiesyour andintended toolsuse, thatinstall additional tools. Here are commonlysome used:common utilities:

      sudo apt install build-essential curl git vim htop -y
    • You

    • Note: Since this is a headless server, you won’tcan install anyother desktop environments.

    d. Configure Networking (If Needed)

    • Use commands like ip a or ifconfig to check your network settings.
    • For advanced networking, edit configuration files in /etc/netplan/ (Ubuntu’s default on recent releases) and apply changes using:
      sudo netplan apply

    e. Set Up Automated Backups

    • Consider installing and configuring backup toolsservices (e.g., rsnapshotweb server, database, etc.) as needed.


      6. Additional DigitalOcean Features

      DigitalOcean offers a range of additional features to manage your server:

      • Snapshots and Backups:
        Consider enabling regular backups or borgbackup)taking snapshots via the DigitalOcean control panel.

      • Monitoring:
        Use DigitalOcean Monitoring to safeguardtrack your serverDroplet’s data.performance.

      • Configure a

        Cloud regularFirewalls:
        Optionally backupconfigure scheduleDigitalOcean viaCloud cronFirewalls jobs.from the control panel for an extra layer of network security.


      9.7. Final Thoughts

      • Documentation:
        Check Familiarizeout yourselfDigitalOcean’s withtutorials and Ubuntu Server documentation for advanced configurationconfigurations.

      • Security:
        Regularly update your server and troubleshooting.

      • monitor
      • Community: Ubuntu Forums and Ask Ubuntu are excellent resources for support and tips.
      • Monitoring: Set up system monitoring tools (e.g., netdata, nagios, or prometheus)logs to keep an eye onyour server health.secure.

      Congratulations! Your Ubuntu 24.04 headless server on DigitalOcean is now installed,set updated,up and configuredready for remotefurther managementcustomization and furtherdeployment customization.of your applications. Enjoy your new serverDigitalOcean environment!Droplet!