A DigitalOcean Droplet is a Linux virtual machine; create it with an SSH public key, then connect using the private key that stays on your computer. This guide walks through the first connection from Terminal on macOS or PowerShell on Windows, followed by cautious initial server setup. It assumes you are creating a new Ubuntu server for learning or a small project, not migrating a live production system.
Before you begin, decide who needs access, which region is near your users, and what the server will run. The monthly cost depends on the selected configuration and optional services such as backups, so check the current control-panel estimate rather than relying on an old tutorial. A Droplet is a server to maintain: you are responsible for operating-system updates, access control, firewall rules, and application backups.
What do you need before creating a Droplet?
You need a DigitalOcean account with billing configured, a local SSH client, and a key pair. macOS includes OpenSSH. Recent Windows installations include OpenSSH Client; check in PowerShell with ssh -V. If the command is unavailable, install the Windows OpenSSH Client optional feature or use an organization-approved SSH client.
An SSH key pair has two files. The private key proves your identity and must remain private; the public key can be uploaded to the cloud account and copied to the server. Do not email, paste, or commit the private key. Use a passphrase when creating one, especially for a key that can administer servers.
How do you create an SSH key on macOS?
Open Terminal and create an Ed25519 key with a clear filename:
ssh-keygen -t ed25519 -C "laptop-droplet"
When prompted for a file, accept the default path if you do not already use that key, or choose a unique path such as ~/.ssh/id_ed25519_droplet. Enter a passphrase. The .pub file is the public key; the file without .pub is private. Display only the public key to copy it:
cat ~/.ssh/id_ed25519.pub
If you chose another filename, use that path instead. Upload the complete public-key line, including its ssh-ed25519 prefix, in DigitalOcean's SSH key area. Never upload the private-key file.
How do you create an SSH key on Windows?
Open PowerShell, not an elevated terminal unless your organization requires it, and run:
ssh-keygen -t ed25519 -C "windows-droplet"
Accept the default path under your user profile or enter a dedicated path. Set a passphrase. Display the public key with:
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub
Copy that public text to DigitalOcean. If PowerShell says the file is missing, inspect the path printed by ssh-keygen; a custom filename or another Windows user account may be the reason. Keep the private file in your profile and do not copy it to a shared folder.
Which Droplet settings should you choose?
In the control panel, choose Create and then Droplets. Select a Linux distribution such as Ubuntu, a region, and a configuration that fits the workload. Select the SSH key you uploaded before clicking Create. The public key is installed for the initial account by the image's provisioning process. If you create a server without a key, the login steps may differ and can require account-specific recovery or password setup.
Choose a server size based on the application's real memory, CPU, and storage needs. Do not assume the smallest plan will handle a production database or traffic spikes. Optional backups and monitoring can add cost; check what is enabled and what it covers. A snapshot or provider backup is not a substitute for testing that you can restore the application and its data.
Can you create the Droplet from a command line?
Yes. DigitalOcean's doctl CLI can create and connect to Droplets. Install it from the official instructions, authenticate with a scoped personal access token in its supported configuration flow, and never save the token in a project repository. List valid region, size, image, and SSH key identifiers before using them:
doctl compute region list
doctl compute size list
doctl compute image list-distribution
doctl compute ssh-key list
Then create a server using real values from those lists:
doctl compute droplet create my-app \
--region nyc1 \
--size s-1vcpu-1gb \
--image ubuntu-24-04-x64 \
--ssh-keys 12345678
Replace the region, size, image, and example SSH key ID with values available to your account and current plan. Do not run the command unchanged with a placeholder key ID. Review the resulting Droplet configuration and cost before creating it. The create command installs the selected public key for the default account; it does not configure your application, replace system updates, or make the server secure by itself.
Once the Droplet exists, the CLI can connect by name or ID:
doctl compute ssh my-app
If the CLI cannot find the matching local key, use its documented --ssh-key-path option or connect with OpenSSH directly. For a smaller number of servers, the web control panel plus standard ssh is often simpler; doctl becomes useful when provisioning needs to be repeatable.
Write down the Droplet's public IPv4 address from its details page. If you will use a cloud firewall, allow inbound SSH (TCP port 22) from your current public IP where practical. Avoid opening database ports to the entire internet. A firewall rule at the provider and a firewall inside Linux are separate controls; understand both before tightening access.
How do you connect from macOS or Windows?
In Terminal or PowerShell, use the server's IP and the username expected by the image. For a standard Ubuntu image created with SSH-key access, that initial user is commonly root; follow the image's current connection instructions if they differ:
ssh root@203.0.113.10
Replace the example address with your Droplet IP. On first connection, SSH asks whether you trust the server's host key. Confirm the fingerprint through the provider's console or a trusted channel if you need to verify identity; accepting an unknown key without checking is not proof of identity. Once accepted, SSH stores the host key in your local known_hosts file and warns if it changes later.
If the key has a non-default filename, explicitly select it:
ssh -i ~/.ssh/id_ed25519_droplet root@203.0.113.10
On Windows, use the equivalent path, for example:
ssh -i $env:USERPROFILE\.ssh\id_ed25519_droplet root@203.0.113.10
After connecting, confirm the remote host and operating system before running administrative commands:
hostname
whoami
lsb_release -a
These commands report the machine name, current user, and distribution details. Do not paste access tokens or private keys into a terminal command that may be recorded in shell history.
What should you do on the server first?
Update package metadata and install available security updates using the distribution's documented process:
sudo apt update
sudo apt upgrade
Read package prompts rather than accepting changes blindly. For routine administration, create a named non-root user and give it only the administrative privileges required:
adduser deploy
usermod -aG sudo deploy
Before closing the initial session, install the public key for that user using a secure method, confirm the ownership and permissions of its .ssh directory, and test a second login in another terminal:
ssh deploy@203.0.113.10
sudo whoami
The second command should print root after the account's sudo password check. Keep the first session open until this test succeeds. Only then consider adjusting root login or password authentication, and follow the current Ubuntu/OpenSSH guidance for the actual configuration. A typo in sshd_config, a missing authorized key, or a restrictive firewall can lock you out. Keep provider-console recovery available and validate SSH configuration before reloading the service.
Enable a host firewall only after allowing the SSH service you actually use. For Ubuntu's uncomplicated firewall, the general sequence is:
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status verbose
If SSH uses a nonstandard port, allow that port before enabling the firewall. Also check the provider firewall; the host firewall cannot permit traffic that an upstream cloud rule blocks.
What changes before this server is ready for a real site?
An SSH login proves access, not production readiness. Choose how the application will run, where its data will live, how updates will be applied, and how you will recover after a failed deployment. Keep application files owned by a limited service or deployment account rather than making every file writable by the web server. Store credentials in a protected environment or secret manager; do not commit .env files or paste database passwords into commands that end up in shell history.
Configure DNS only after the application responds as intended over the server's IP or a temporary hostname. Add TLS using a maintained certificate workflow and verify renewal. If the application handles personal or payment data, assess the hosting provider, retention, access logging, backups, and legal obligations before copying production data. Never use a real customer database as a casual SSH test fixture.
Before any deployment, record the current image, server size, firewall rules, user accounts, and backup schedule. A small written runbook with the IP, owner, recovery console, and restore steps is more useful than a collection of private keys. Keep access details in an approved password manager and limit who can retrieve them. Remove a user's key when their access is no longer needed, and review keys periodically rather than waiting for a laptop to go missing.
What if SSH does not connect?
Separate network reachability from authentication. A timeout commonly means the IP, route, or firewall is wrong; Permission denied (publickey) means the server was reached but did not accept the presented key or username. Use verbose SSH diagnostics and compare the identity file, remote account, and address. The companion SSH troubleshooting guide walks through those errors on both operating systems.
Do not delete known_hosts wholesale to silence a changed-host warning. First confirm that the server was rebuilt or its host key legitimately changed. If verified, remove only that host's saved entry using ssh-keygen -R 203.0.113.10 and reconnect to verify the replacement fingerprint.
A safe first-connection checklist
- Generate a key locally and upload only its public half.
- Choose the server region, image, size, and optional services with costs in mind.
- Allow SSH only from the networks that need it, where feasible.
- Verify the server identity and use the intended username and key.
- Create and test a named administrative account before changing root access.
- Keep a tested backup and a recovery route before hosting valuable data.
For authoritative steps, use DigitalOcean's Droplet creation guide, SSH connection guide, and SSH key guide. Windows users can also consult Microsoft's OpenSSH key management documentation. For deployments after initial access, start with the WordPress maintenance and backup checklist and adapt its staging and restore principles to your application.
