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- Sign
SystemUp Requirements
/ Log In:
Processor:Visit2DigitalOceanGHzanddual-corelog in orbettersign up for an account.
DiskMakeSpace:Minimum 20 GB (adjust based onsure yourintendedbillingserver usage)Network:Ethernet or Wi-Fi adapter (wiredinformation ispreferredsetforupservers)so ConsoleyouAccess:canEithercreatedirect physical access or remote (via IPMI/KVM) since no GUI will be availableDroplets.
b. Backup Your Data
Warning:A clean installation willerase all dataon the chosen drive. Back up important files and configurations.
2. DownloadCreate thea New Droplet with Ubuntu 24.04 Server ISO
3. CreateConnect ato BootableYour USBDroplet Drivevia SSH
a. Using Rufus (Windows)
-
Download and Install Rufus:Visitrufus.ieand download the latest version. InsertOpen aUSB Drive:Ensure it’s at least 2 GB (all data on the USB will be erased).Open Rufus and Configure:Terminal:Device:OnSelectLinux/macOS, open yourUSB drive.terminal.BootOnselection:Windows,Clickuse“SELECT”anandSSHchooseclient like PuTTY or theUbuntubuilt-in24.04WindowsServer ISO.Partition scheme:ChooseGPTfor UEFI systemsTerminal (most modern PCs).ChooseMBRyouusingneed BIOS/Legacy support.
File System:Typically “FAT32” (default)OpenSSH).
-
StartConnect to theProcess:Click “START” and confirm any warnings. Rufus will now create your bootable USB drive.
b. Using balenaEtcher (macOS/Linux/Windows)
Download Etcher:Go tobalenaEtcherand download the version for your OS.Install and Run Etcher:Droplet:SelectRun theUbuntufollowing24.04command,ServerreplacingISO.Choose(usuallyroot
on first login) and<droplet_ip>
with yourUSBDroplet’sdrive.IP Click “Flash!” and wait for the process to finish.
username
c. Using the dd
Command (Linux/macOS)
Warning:The
ddcommand is powerful. Ensure you’ve selected the correct drive to avoid data loss.
Identify the USB Drive:address:lsblkssh root@<droplet_ip>WriteIftheusingISOantoSSHthekey,USB:Replace/dev/sdXwithensure yourUSBkeydeviceis loaded (do not include a partition number, e.g., useusing/dev/sdbssh-agentinstead 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
Insert the Bootable USB Driveinto the server hardware.Restart Your Server.Enter BIOS/UEFI Settings:Common keys:F2,F12,DEL,or specifyingESC-i path/to/your/key(refer to your hardware’s documentation)).Set the boot order to prioritize booting from the USB drive.
-
Save and Exit:Your server should now boot fromAccept theUSB drive.Fingerprint:
5. Starting the Ubuntu Server Installation
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 pressEnter.
b. Select Your Keyboard Layout
Screen:“Keyboard Configuration”Action:Choose your layout (often “English (US)” or your regional setting) and pressEnter.
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 pressEnter.
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
Installation Complete:Once the process is finished, you’ll be prompted to remove the installation media.Restart Your Server:Remove the USB drive.PressEnterto reboot.
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
Log In via Console or SSH:If you enabled the SSH server, you can now connect remotely.- Update Package
ListsLists:andapt update
- Upgrade Packages:
sudo apt update sudoapt upgrade-y Clean Up Unused Packages:sudo apt autoremove-y
b. Create a Non-Root User (Optional but Recommended)
- Create a User:
adduser yourusername
- Grant Sudo Privileges:
usermod -aG sudo yourusername
- Test by Logging in as Your New User:
- Log out of the root session:
exit
- Log in again using:
ssh yourusername@<droplet_ip>
- Log out of the root session:
c. Secure RemoteSSH Access
-
Edit the SSH Configuration:
Theserversudo
installernanoshould have set up SSH, but you can further harden it:Edit/etc/ssh/sshd_config
to -
Recommended Changes:
- Disable root login
and(ifconsidernotchangingneeded):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
, thenY
, thenEnter
).
- Disable root login
-
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:
EnableAllowUFW:SSH Connections:sudo ufw allow ssh
- If you changed your SSH port, use:
sudo ufw allow 2222/tcp
- If you changed your SSH port, use:
- Enable UFW:
sudo ufw enable
- Check Firewall Status:
sudo ufw status verbose
c.5. Install Essential Server Packages
Installonutilitiesyourandintendedtoolsuse,thatinstall additional tools. Here arecommonlysomeused:common utilities:sudo apt install build-essential curl git vim htop -y
Note:Since this is a headless server, you won’tcan installanyotherdesktop environments.
Depending
You
d. Configure Networking (If Needed)
Use commands likeip aorifconfigto 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.,
web server, database, etc.) as needed.rsnapshot
6. Additional DigitalOcean Features
DigitalOcean offers a range of additional features to manage your server:
-
Snapshots and Backups:
Consider enabling regular backups orborgbackup)taking snapshots via the DigitalOcean control panel. -
Monitoring:
Use DigitalOcean Monitoring tosafeguardtrack yourserverDroplet’sdata.performance. ConfigureaCloud
regularFirewalls:
OptionallybackupconfigurescheduleDigitalOceanviaCloudcronFirewallsjobs.from the control panel for an extra layer of network security.
9.7. Final Thoughts-
Documentation:
CheckFamiliarizeoutyourselfDigitalOcean’swithtutorials and Ubuntu Server documentation for advancedconfigurationconfigurations. -
Security:
Regularly update your server andtroubleshooting.monitor Community:Ubuntu Forums and Ask Ubuntu are excellent resources for support and tips.Monitoring:Set up system monitoring tools (e.g.,netdata,nagios, orprometheus)logs to keepan eye onyour serverhealth.secure.
Congratulations! Your Ubuntu 24.04 headless server on DigitalOcean is now
installed,setupdated,up andconfiguredready forremotefurthermanagementcustomization andfurtherdeploymentcustomization.of your applications. Enjoy your newserverDigitalOceanenvironment!Droplet!-