How to Deploy Nextcloud AIO with Docker Compose
Nextcloud replaces Google Drive, Calendar, and Contacts. Deploy it in 15 minutes with Docker Compose and get your private cloud running.
Nextcloud gives your business private file storage, shared calendars, contacts, and document editing. It replaces Google Drive, Google Calendar, and Google Contacts with a single application you control. Here is how to deploy it with Docker Compose in 15 minutes.
Prerequisites
- A server running Ubuntu 22.04 or newer with Docker and Docker Compose installed
- A domain name pointed at your server (cloud.yourdomain.com)
- Ports 80 and 443 open on your firewall
Step 1: Create the Docker Compose File
Create a directory for Nextcloud and a docker-compose.yml file:
mkdir nextcloud && cd nextcloud
nano docker-compose.ymlPaste this configuration:
services:
nextcloud-aio:
image: nextcloud/all-in-one:latest
container_name: nextcloud-aio
restart: unless-stopped
ports:
- "80:80"
- "8443:8443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
environment:
- APACHE_PORT=1100
- AIO_DISABLE_BACKUP_SECTION=false
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainerStep 2: Start the Containers
docker compose up -dWait 30 seconds for the master container to initialise. Open your browser to https://your-server-ip:8080. You will see the Nextcloud AIO setup page.
Step 3: Configure AIO
Enter your domain name (cloud.yourdomain.com). The AIO setup will walk you through creating an admin password and configuring the internal containers. Click Start Containers. AIO will download and start the full stack: Nextcloud server, PostgreSQL database, Redis cache, Collabora document server, and the notification service.
This takes 5 to 10 minutes depending on your internet connection. The AIO interface shows the progress of each container.
Step 4: Log In and Configure
Once all containers show as running, open https://cloud.yourdomain.com. Log in with the admin credentials you created. The AIO setup handles SSL certificates automatically through Let's Encrypt.
From the Nextcloud admin panel:
- Create user accounts for your team
- Install apps: Calendar, Contacts, Deck (project management), Talk (video calls), and Mail
- Configure external storage if you want to connect network drives or S3-compatible storage
- Set up two-factor authentication in the Security settings
Step 5: Configure Automatic Backups
Nextcloud AIO includes a built-in backup solution. In the AIO interface, go to Backup and configure:
- Backup schedule: daily at 2 AM
- Backup location: a mounted volume or network path
- Retention: keep the last 14 daily backups
For offsite backups, configure BorgBackup or Kopia to copy the backup directory to a remote server or object storage daily.
Performance Tuning for Production
After your team starts using Nextcloud, tune these settings for better performance:
# Add to Nextcloud config.php
'filelocking.enabled' => true,
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => [
'host' => 'redis',
'port' => 6379,
],In the AIO interface, you can add these settings through the Nextcloud config editor without touching configuration files directly.
If the terminal makes you nervous, VPS1 deploys Nextcloud for you. We handle the server, Docker, SSL, backups, and performance tuning. You get a fully configured private cloud with zero command-line work.
More articles
How to Deploy BTCPay Server: Accept Bitcoin Payments with Zero Platform Fees
BTCPay Server lets you accept Bitcoin and Lightning payments with no platform fees. Only standard Bitcoin network fees apply. Here is how to deploy it with Docker Compose.
Self-Hosted Crypto Payment Processors: BTCPay Server, Bitcart, and SHKeeper Compared
Accept Bitcoin and cryptocurrency payments directly with no platform fees, no intermediaries, and no KYC. Here is how BTCPay Server, Bitcart, and SHKeeper compare.
How to Deploy SHKeeper: Accept Crypto Payments with WooCommerce in 30 Minutes
SHKeeper supports Bitcoin, Ethereum, USDT, USDC, and 19+ cryptocurrencies with a free WooCommerce plugin. Zero platform fees -- only standard network fees apply.