Skip to content

AssachanDev/nextcloud-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

☁️ Nextcloud Self-Hosted

Personal cloud storage running on Docker + Tailscale

Nextcloud Docker MariaDB Tailscale


📋 Prerequisites

Requirement Details
OS Ubuntu Server
Network Tailscale installed & connected
Storage NAS mounted at /mnt/nas

🚀 Quick Start

1 — Install Docker

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

2 — Create Project Directory

mkdir -p ~/Projects/nextcloud
mkdir -p /mnt/nas/nextcloud
cd ~/Projects/nextcloud

3 — Configure Environment Variables

cp .env.example .env
nano .env
# .env.example
MYSQL_ROOT_PASSWORD=changeme_root
MYSQL_PASSWORD=your_db_password
NEXTCLOUD_ADMIN_PASSWORD=your_admin_password

Warning

.env is ignored by git — never commit real passwords.

4 — Start Nextcloud

docker compose up -d
docker compose ps   # verify containers are running

5 — Add Trusted Domain (Tailscale IP)

Note

Setup via browser (no NEXTCLOUD_ADMIN_USER/NEXTCLOUD_ADMIN_PASSWORD set in .env): Nextcloud auto-adds the trusted domain during the web installer — skip this step.

Setup via .env credentials: Nextcloud auto-installs on first start and does not add the trusted domain automatically — you must run the occ command below after installation completes.

# Fix "untrusted domain" error:
docker exec -u 33 -it nextcloud php occ config:system:set trusted_domains 1 --value=<tailscale-ip>

# Fix data directory permission error:
sudo chown -R 33:33 /mnt/nas/nextcloud

Replace <tailscale-ip> with your server's Tailscale IP — e.g. xxx.xxx.xxx.xxx

6 — Enable Auto-start on Reboot

sudo systemctl enable docker

Containers restart automatically via restart: always in docker-compose.yml


🌐 Accessing Nextcloud

Open your browser and go to:

http://<tailscale-ip>:8080
Field Value
Username admin
Password value of NEXTCLOUD_ADMIN_PASSWORD in .env

📱 Desktop & Mobile Client

Download the Nextcloud client from https://nextcloud.com/install/#install-clients

Connect using server URL: http://<tailscale-ip>:8080


📁 File Structure

nextcloud/
├── 🐳 docker-compose.yml   # service definitions
├── 🔒 .env                 # your secrets (not committed)
├── 📄 .env.example         # template — safe to commit
├── 🚫 .gitignore
└── 📖 README.md

🛠️ Useful Commands

Action Command
View logs docker compose logs -f nextcloud
Stop docker compose down
Update docker compose pull && docker compose up -d
Restart docker compose restart

📝 Notes

  • Files are stored on NAS at /mnt/nas/nextcloud/admin/files/
  • Nextcloud is only accessible within the Tailscale network
  • On mobile: install Tailscale app and connect before opening Nextcloud

About

Self-hosted Nextcloud on Docker with NAS storage, accessible via Tailscale.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors