DEV Community

Cover image for How I Built a Home Cloud Server Using an Old Laptop and Nextcloud
Neil Brown
Neil Brown

Posted on

How I Built a Home Cloud Server Using an Old Laptop and Nextcloud

Like many developers, I had an old laptop sitting in a drawer—slow, outdated, and basically unusable for modern apps. But instead of tossing it away, I decided to transform it into something useful: a private cloud server.

Now I have my own secure file storage system (like Google Drive or Dropbox), hosted right from my home. Here’s how I did it, step-by-step, using Nextcloud, Docker, and a little weekend effort.

Why I Wanted My Own Cloud

  • I love cloud storage, but I’m not a fan of:
  • Storage limits
  • Privacy concerns
  • Monthly fees

With Nextcloud, I get a Google Drive-like UI, mobile access, calendar, contacts, notes, and collaboration tools, but hosted entirely by me, with full control over data.

Hardware I Used

Laptop: Old Lenovo ThinkPad (Core i3, 4GB RAM, 256GB HDD)

OS: Ubuntu Server 22.04 (no GUI for better performance)

Network: Home Wi-Fi router

Static IP: Reserved via router settings

Step 1: Installing Ubuntu Server
I downloaded the Ubuntu Server ISO and used Rufus to flash it onto a USB stick. After booting and installing Ubuntu on the laptop, I did:
sudo apt update && sudo apt upgrade

Then I created a new user account, secured SSH access, and enabled UFW firewall:
sudo ufw allow OpenSSH
sudo ufw enable

Now I could manage the server from my main machine via SSH.

Step 2: Installing Docker + Docker Compose
To simplify everything, I decided to run Nextcloud using Docker containers:

sudo apt install docker.io docker-compose -y
sudo usermod -aG docker $USER

Then log out and log in again to apply the Docker group change.

Step 3: Setting Up Nextcloud with Docker Compose
Here’s the docker-compose.yml I used:

version: '3'

services:
  db:
    image: mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: nextcloudpass
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: ncuser
      MYSQL_PASSWORD: ncpass
    volumes:
      - db:/var/lib/mysql

  app:
    image: nextcloud
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    restart: always

volumes:
  db:
  nextcloud:

Enter fullscreen mode Exit fullscreen mode

Then I ran:
docker-compose up -d

And visited http://your-ip:8080 in the browser. The Nextcloud setup wizard appeared, and I created an admin account.

Step 4: Accessing My Cloud From Anywhere
I wanted to access my cloud even when not at home. I had three options:

  • Port forwarding (insecure)
  • Dynamic DNS + HTTPS (complicated)
  • Cloudflare Tunnel (secure, easy)

I went with Cloudflare Tunnel. It hides your IP and automatically uses HTTPS. Here's how I set it up:

wget https://github.com/cloudflare/cloudflared/releases
sudo mv cloudflared /usr/local/bin/
cloudflared tunnel login
cloudflared tunnel create nextcloud

Enter fullscreen mode Exit fullscreen mode

Then I set up the tunnel with a config file:

tunnel: nextcloud
credentials-file: /root/.cloudflared/nextcloud.json

ingress:
  - hostname: cloud.yourdomain.com
    service: http://localhost:8080
  - service: http_status:404

Enter fullscreen mode Exit fullscreen mode

And linked it to a domain via Cloudflare dashboard.

Step 5: Using It On Mobile and Desktop
Nextcloud offers official iOS, Android, Windows, and Mac apps. I installed them all and synced my photos, docs, and notes.

You can also install:

OnlyOffice/Collabora: for editing Word, Excel, etc.

Calendar & Contacts: CalDAV/CardDAV compatible

Notes, Tasks, Bookmarks: Great for productivity

Bonus: HTTPS with SSL (If You Prefer Port Forwarding)
If you skip Cloudflare Tunnel and open ports manually, set up HTTPS with Let’s Encrypt:

sudo apt install certbot
sudo certbot certonly --standalone -d cloud.yourdomain.com

Then link certs to Nextcloud’s container using volume mounts.

What I Learned

Old laptops aren’t useless — they’re perfect for light server tasks

Docker simplifies complex setups — no messy configs

Privacy is powerful — no third-party owns my data anymore

Cloudflare Tunnel rocks — no open ports, no NAT headaches

What I Might Add Next

  • Auto backup to another drive
  • External USB storage integration
  • OnlyOffice for document editing
  • CPU/GPU monitoring with Prometheus + Grafana

Conclusion

If you have an old laptop lying around, don’t let it collect dust. Turn it into a self-hosted private cloud. It’s surprisingly easy, cost-free, and gives you total control over your data.

Want help setting this up or customizing it for your team or business? Reach out—I’d love to help or even write a guide on scaling it to serve small teams!

Looking for SEO Services in Texas? Feel free to fill the form and we will make your website rank #1 on Google. You can be from anywhere in this world to rank your website anywhere in the world. Just, go ahead and fill the form by clicking the link above.

Top comments (1)

Collapse
 
ron_beernink_c50a4a970687 profile image
Ron Beernink

The last bit about setting up a config file for Cloudflare is missing the instruction on where to find / create this file. Here's the instructions I found:

_Setting up the config.yml file for a Cloudflare Tunnel on an Ubuntu server involves defining the tunnel's UUID, the path to its credentials file, and the ingress rules that dictate how traffic is routed.

  1. Locate the cloudflared directory:
    The configuration file is typically located in the ~/.cloudflared/ directory (or /root/.cloudflared/ if running as root). Navigate to this directory using the cd command:
    cd ~/.cloudflared/

  2. Create or edit the config.yml file:
    If the file doesn't exist, create it. If it exists, open it for editing. You can use a text editor like nano or vim:
    nano config.yml_

Some comments may only be visible to logged-in visitors. Sign in to view all comments.