February 2026
Disclosure: This post contains affiliate links to DigitalOcean. If you sign up through my links, I may earn a commission at no extra cost to you. I only recommend tools I actually use.
I’ve been running Ayema on cloud infrastructure for a while now. We crossed 100,000 users last year, and along the way I made plenty of mistakes with hosting, deployments, and server management. This guide is what I wish someone had told me when I started.
If you’re a developer in Nigeria (or anywhere in Africa) trying to figure out where to host your app, this is for you.
Why I Went with DigitalOcean
I tried a few providers before settling on DigitalOcean. Here’s the honest breakdown:
AWS is powerful but the billing gave me anxiety. I once left a test instance running and the bill was… let’s just say I learned to set billing alerts the hard way.
DigitalOcean just made sense for what I needed. Droplets start at $4/month, and what you see is what you pay. No surprise charges for “data egress” or whatever.
The other thing – their documentation is genuinely good. When I was learning server administration, I probably read 50+ DigitalOcean tutorials. They explain things properly, not just copy-paste commands without context.
(ad) Sign up for DigitalOcean here – they give new users $200 in credits to test things out.
The Setup I Actually Use
I’m not going to pretend I run some fancy Kubernetes cluster. For most projects, here’s what works:
- Ubuntu 22.04 on a basic Droplet
- Nginx as reverse proxy
- PM2 to keep Node.js running
- Let’s Encrypt for SSL (free)
That’s it. Nothing fancy. It handles traffic fine.
Picking a Data Center
This matters more than people think. I use the Frankfurt data center for most things. London works too, but I’ve found Frankfurt routes slightly better to Lagos – at least on MTN and Airtel.
If you’re on Glo… well, you know how that goes. Some days it works, some days you’re debugging “connection timeout” errors that have nothing to do with your code.
Step by Step: Getting Your App Live
1. Create the Droplet
Log into DigitalOcean, hit Create → Droplets.
Pick:
- Ubuntu 22.04 (LTS means long-term support, fewer surprise updates breaking things)
- Frankfurt or London region
- Basic plan – the $6/month one with 1GB RAM is fine for starting out. You can resize later.
- SSH keys for login. Seriously, don’t use password authentication.
Takes about a minute to spin up.
2. First Login and Basic Security
SSH in:
ssh root@your_server_ip
First thing – create a normal user. Running everything as root is asking for trouble:
adduser deploy
usermod -aG sudo deploy
Copy your SSH keys over to the new user:
rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy
Set up the firewall:
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Update everything:
apt update && apt upgrade -y
Now log out and log back in as your deploy user. Don’t use root anymore.
3. Install Node.js
I use NodeSource to get a recent version:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
Check it worked:
node --version
4. Get Your Code on the Server
Switch to your deploy user’s home directory:
cd ~
mkdir apps
cd apps
git clone https://github.com/yourusername/your-app.git
cd your-app
npm install --production
Set up your environment variables. I keep mine in a .env file:
nano .env
Add whatever your app needs:
NODE_ENV=production
PORT=3000
DATABASE_URL=your_connection_string
5. PM2 – Keeping Your App Alive
PM2 is a process manager. It restarts your app if it crashes and brings it back up after server reboots.
sudo npm install -g pm2
pm2 start app.js --name "myapp"
pm2 save
pm2 startup systemd
That last command prints out another command you need to run – copy and paste it.
6. Nginx Reverse Proxy
Install Nginx:
sudo apt install nginx -y
Create a config file:
sudo nano /etc/nginx/sites-available/myapp
Paste this (change the domain name):
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache_bypass $http_upgrade;
}
}
Enable it:
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
7. SSL Certificate
No excuse not to have HTTPS these days. Let’s Encrypt is free:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Follow the prompts. It sets up auto-renewal too.
Things I Learned the Hard Way
Add swap space on small Droplets. The 1GB RAM ones will occasionally kill your Node process if memory spikes. This saved me a lot of headaches:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Enable backups. DigitalOcean charges 20% extra for weekly backups. On a $6 Droplet that’s $1.20/month. I learned to appreciate this after a deployment went wrong at 11pm and I just wanted to roll back and sleep.
Cloudflare helps a lot for Nigerian users. They have edge servers in Lagos now. Put Cloudflare in front of your site (free plan is fine) and your Nigerian visitors get much faster load times.
Check your logs. When something breaks:
pm2 logs myapp
sudo tail -f /var/log/nginx/error.log
90% of the time the answer is in there.
When to Upgrade
The basic Droplet works fine until it doesn’t. Signs you need more resources:
- Response times getting slow
- PM2 showing memory at 90%+ constantly
- Nginx 502 errors during traffic spikes
You can resize your Droplet with a few clicks, or start looking at load balancers if you need to run multiple servers.
Wrapping Up
This setup has served me well for Ayema and several other projects. It’s not the most sophisticated architecture, but it works, it’s affordable, and I can debug it at 2am when something breaks.
If you’re just starting out, don’t overcomplicate it. Get something deployed, make sure it’s secure, and improve from there.
(ad) Get $200 in DigitalOcean credits to try this yourself
Questions? Find me drop a comment.
