Skip to main content
digitalocean

How to Deploy a Website on DigitalOcean in Minutes

Published: | Tags: cloud hosting, deployment

Getting Started with DigitalOcean Deployment

DigitalOcean has emerged as one of the leading cloud platforms for developers and startups primarily due to its ease of use, scalability, and budget-friendly options. If you're aiming to get your application up and running quickly, deploying a site to DigitalOcean can be accomplished in a matter of minutes. This article will guide you through the essentials and help you skip over the usual mistakes.

Why Use DigitalOcean?

  • Intuitive interface with a straightforward dashboard for managing Droplets (virtual machines).
  • Scalable hosting — upgrade the CPU, memory, and storage as your project grows.
  • Low-cost options starting from $5/month for smaller applications.
  • Robust community support with helpful tutorials and documentation for developers.

Before you jump into the deployment, all you need is a couple of essentials: a domain, a DigitalOcean account, and a basic understanding of your application's tech stack (like PHP, Node.js, and even undefined HTML). For a perspective on how the host options stack up, have a look at our article on Best Cloud Hosting Platforms for Scaling Projects in 2025.

Note: If you don't have a DigitalOcean account yet, signing up through their referral often helps you score free credits to try things out.

After the account is set up, the next point is creating a Droplet: the heart of any deployment on DigitalOcean. We’ll break this down step by step in the next section.

Step 1: Setting Up a DigitalOcean Droplet

A Droplet is DigitalOcean's version of a virtual machine, and it's the place where your website will be hosted. To get started:

  1. Log into your DigitalOcean account.
  2. Select CreateDroplets from the menu across the top.
  3. Choose which operating system you’d like to use (Ubuntu is popular for web apps).
  4. Choose a plan—$5/month is sufficient for most small projects.
  5. Choose a datacenter region (the one closest to your audience is typically fastest).
  6. Add your SSH keys for secure logins (recommended) or choose to use a root password.
  7. Click Create Droplet and give it a minute or so for provisioning.

Security Tip: Always use SSH keys instead of root passwords. This will protect you against brute-force attacks and keep your server more secure.

Step 2: SSH-ing Into Your New Droplet

Once your droplet is active, it’s time to connect via SSH. Open up your terminal and type:

ssh root@your_droplet_ip

Where your_droplet_ip is the actual IP address of your droplet you can find in your DigitalOcean dashboard. Now that you're logged in, you should install your web server (like Nginx or Apache).

Step 3: Pointing Your Domain to DigitalOcean

If you want to use your own domain instead of the one DigitalOcean provides, you'll need to point your domain at DigitalOcean. Here's how to do this:

  • Log into your domain registrar (Namecheap, GoDaddy, etc.).
  • Find the DNS settings and set the A record to your droplet's IP.
  • Optionally, set a CNAME for www to point to your root domain.

It may take a few hours for the DNS to propagate, but once it does, your domain will point directly to your droplet. And if you're interested in other hosting options, check out our article on Shared Hosting Explained: The Pros, Cons, and When It's the Wrong Option.

Step 4: Set up Your Web Server

Now that you have a running Droplet and your domain is pointed correctly, it's time to set up the web server. The two most popular options are Nginx (pronounced as "engine x") or Apache.


# Install Nginx
sudo apt update
sudo apt install nginx -y

# Install Apache (alternative)
sudo apt update
sudo apt install apache2 -y

After the installation is finished, you can check whether the server is running by visiting your domain from a browser window. You should see the default landing page of Nginx or Apache, whichever you installed.

Step 5: Upload Your Website

You’re almost done! Just upload your project files to the Droplet. You can use scp (secure copy), SFTP, or Git if you're cloning from a repo. For example:


scp -r ./my-website/* root@your_droplet_ip:/var/www/html

Make sure to replace ./my-website/ with the path to your actual project files. Don’t forget to give the proper file permissions so your server can read them.

Step 6: Enable HTTPS with Let's Encrypt

A secure website isn’t optional anymore in 2025. Fortunately, enabling SSL with Let’s Encrypt is just a couple of commands away:


sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Certbot will automatically issue an SSL certificate and configure it for your domain. The certificates will auto-renew within 30 days so your website stays secure.

Congratulations! You just deployed a fully functional and secure website on DigitalOcean in just a couple of minutes.

If you're interested in building and scaling your website for performance, check out our article on Hosting vs VPS: Key Differences Explained.