Загрузка...

Self-Host Nextcloud in 15 Minutes - Docker Compose Tutorial for Beginners

In this tutorial, I show you how to install Nextcloud as a Docker container using Docker Compose. Nextcloud is a self-hosted alternative to Google Drive, Dropbox, and other cloud storage services - you own your data, you control access, and there are no monthly subscription fees.

I'm using Ubuntu/Pop!_OS for this tutorial, but these steps will work on any Linux system running Docker.

This is a beginner-friendly tutorial - if you have basic command line knowledge and Docker already installed, you can follow along.

⏰ TIMESTAMPS
0:00 - Intro
0:33 - Prerequisites & what you'll need
1:26 - Checking for available ports
2:55 - Creating the project directory
3:19 - Creating the port-mapping text file
4:28 - Setting up the .env file
6:49 - Creating the docker-compose.yml
10:07 - Starting the containers
10:28 - First login & initial setup
11:51 - What's next

📋 PREREQUISITES
✅ Docker installed
✅ Docker Compose installed
✅ Basic command line knowledge
✅ About 15-20 minutes

💻 MY SETUP
- OS: Pop!_OS (Ubuntu-based)
- Hardware: Home server setup
- Background: Former network engineer, now hobbyist self-hoster

📁 FILES & COMMANDS
*Create project directory:*
mkdir -p /**your**/**desired**/**folder**/docker/nextcloud # I started using /opt/docker/
cd /**your**/**desired**/**folder**/docker/nextcloud

*Check if port is in use:*
ss -tulpn | grep ":8080"

*If port 8080 isn't being used, then leave the docker-compose.yml file port setting as-is skip "Check port range for availability." If port 8080 is already used by another app, continue below.*

*Check port range for availability:*
for port in {5322..5342}; do
if ss -tuln | grep -q ":$port "; then
echo "🔴 Port $port: IN USE"
else
echo "🟢 Port $port: Free"
fi
done

*Track your port mappings (optional):*
cd /**your**/**desired**/**folder**/docker # CHANGE THIS
sudo nano port_mappings.txt
Add entries like:
Port App
5322 Nextcloud
5323 [Next app]

*Create .env file:*
cd /**your**/**desired**/**folder**/docker/nextcloud # CHANGE THIS
nano .env
Contents:
# CHANGE THESE
MYSQL_ROOT_PASSWORD=your_secure_password
MYSQL_PASSWORD=your_secure_password
# DON'T CHANGE THESE
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
# CHANGE THESE
NEXTCLOUD_ADMIN_USER=your_preferred_username
NEXTCLOUD_ADMIN_PASSWORD=your_admin_password

Then hit the CTL+X buttons to save it, Y to keep the file name the same, and Enter to finally complete the save.

*Download the docker-compose.yml*
Grab the docker-compose.yml here:
https://codeberg.org/semico6/seths_public_repo/src/branch/main/docker-compose/nextcloud/docker-compose.yml

**Assuming you saved the file to ~/Downloads, run this command:**
mv ~/Downloads/docker-compose.yml /**your**/**desired**/**folder**/docker/nextcloud/

Next, open the docker-compose.yml file and edit the sections with comments:
cd /**your**/**desired**/**folder**/docker/nextcloud/
sudo nano /**your**/**desired**/**folder**/docker/nextcloud/docker-compose.yml

Then hit the CTL+X buttons to save it, Y to keep the file name the same, and Enter to finally complete the save.

*Start Nextcloud:*
From a terminal, change to the nextcloud directory:
cd /**your**/**desired**/**folder**/docker/nextcloud

Then type this command:
docker compose up -d

Hopefully you'll see the container status as 'Started' in the command output. If not, leave a comment and I'll try to help.

*To access Nextcloud:*
Open a browser and navigate to: http://localhost:8080 (unless you used a different port. if so, use that port number).

Login with the credentials from your .env file's NEXTCLOUD_ADMIN_USER and NEXTCLOUD_ADMIN_PASSWORD and start playing around with Nextcloud!

🔗 USEFUL LINKS
- Nextcloud documentation: https://docs.nextcloud.com
- Docker installation guide: https://docs.docker.com/engine/install/
- Docker Compose installation guide: https://docs.docker.com/compose/install/linux/

📝 NOTES
- Change the passwords in the .env file to something secure
- Port 8080 is customizable - use any available port
- The .env file keeps sensitive passwords out of your compose file
- All data is stored in the local ./data and ./db directories

🎯 WHAT'S NEXT
In future videos, I'll show you:
- Adding OnlyOffice for document editing
- Setting up remote access with a domain name
- Backing up your Nextcloud data
- Advanced features and apps

💬 QUESTIONS?
Drop them in the comments - I read and respond to all of them.

📺 ABOUT THIS CHANNEL
I'm not a professional sysadmin or developer - I used to be a network engineer, but these days I'm just a hobbyist figuring out self-hosting for my home setup. I share tutorials on digital sovereignty, self-hosting, physical media ownership, and taking control from big tech. If you're interested in owning your digital life instead of renting it, subscribe for more.

#nextcloud #selfhosted #docker #dockercompose #privacy #digitalownership

Видео Self-Host Nextcloud in 15 Minutes - Docker Compose Tutorial for Beginners канала Mr. Audio Feedback
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять