Self-Hosted Cloud Storage: Setting Up Nextcloud via Docker
Taking complete ownership of your personal files, calendar events, and contacts is simple with Nextcloud. By deploying Nextcloud inside a Docker container paired with a MariaDB database, you eliminate monthly cloud subscription fees while maintaining complete data privacy. At Android People (androidpeople.in), we share a step-by-step installation guide.
Creating Docker Compose Configuration File
Create a directory named nextcloud on your server and save the following docker-compose.yml file:
version: '3.8'
services:
db:
image: mariadb:10.11
restart: always
environment:
MYSQL_ROOT_PASSWORD: YourSecureRootPassword
MYSQL_PASSWORD: YourDatabasePassword
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
volumes:
- db_data:/var/lib/mysql
app:
image: nextcloud:latest
restart: always
ports:
- 8080:80
environment:
MYSQL_PASSWORD: YourDatabasePassword
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_HOST: db
volumes:
- nextcloud_data:/var/www/html
volumes:
db_data:
nextcloud_data:Deploying and Initial Administrator Setup
Run docker compose up -d to pull container images and initialize the services. Open a browser and navigate to http://<YOUR_SERVER_IP>:8080 to create your administrator account and complete setup.
For more home server tutorials and self-hosting guides, visit Android People.