The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →You can run Nextcloud in Docker with an Apache container, a persistent data volume, and a database container. This guide sets up a MariaDB-backed deployment with Redis, explains how to start it and finish setup, and covers trusted domains, HTTPS, backups, and updates. For a quick local test, you can use the official image alone; for a useful deployment, plan for persistent storage and a database.
Choose a Docker setup
The official Nextcloud image supports SQLite, MariaDB/MySQL, and PostgreSQL. Configure exactly one database for the installation. SQLite avoids managing a separate database service and can suit a small test; MariaDB/MySQL or PostgreSQL adds a separate service that should be backed up alongside Nextcloud.
| Decision | Simpler option | More production-oriented option |
|---|---|---|
| Database | SQLite for a small test | MariaDB/MySQL or PostgreSQL service |
| Web image | nextcloud:apache serves HTTP directly |
nextcloud:fpm behind Nginx; FPM does not serve static files by itself |
| Caching | Omit Redis | Add Redis for memory caching and PHP sessions |
| Storage | Named Docker volumes | Explicit host mounts with a backup plan |
| Exposure | Local test at localhost:8080 |
HTTPS reverse proxy and a complete trusted-domain list |
The example below follows the official MariaDB, Redis, and Apache pattern. Apache publishes HTTP on port 8080, which is convenient for a local setup; do not expose an internet-facing installation without TLS.
Install Docker and create a project directory
Install Docker Engine and the Docker Compose plugin on the host. Then create a directory for the Compose file and change into it. The official Nextcloud Docker repository provides Compose examples, including the MariaDB/Redis/Apache arrangement used here: Nextcloud Docker repository.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
mkdir nextcloud-docker
cd nextcloud-docker
Create the Compose file with persistent services
Create compose.yaml in the project directory with this configuration:
services:
db:
image: mariadb:lts
restart: always
command: --transaction-isolation=READ-COMMITTED
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=change-this-root-password
- MYSQL_PASSWORD=change-this-app-password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
redis:
image: redis:alpine
restart: always
app:
image: nextcloud:apache
restart: always
ports:
- 8080:80
depends_on:
- db
- redis
volumes:
- nextcloud:/var/www/html
environment:
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=change-this-app-password
- REDIS_HOST=redis
- NEXTCLOUD_TRUSTED_DOMAINS=localhost
volumes:
db:
nextcloud:
Replace both example passwords with strong secrets before starting the stack. The official image documents supported _FILE variables and Docker secrets for credentials; see its environment-variable and Compose documentation.
What the volumes preserve
The nextcloud named volume stores /var/www/html, which contains the Nextcloud installation and uploaded files. The separate db volume stores MariaDB’s files at /var/lib/mysql. Keeping both persistent means replacing or recreating containers does not, by itself, discard their stored data. Named volumes are managed by Docker; host mounts are an alternative when you want to choose explicit host paths, but either approach needs a backup plan.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Using PostgreSQL or SQLite instead
Do not configure MariaDB and PostgreSQL at the same time. For PostgreSQL, replace the MariaDB service and its MYSQL_* settings with a PostgreSQL service and matching POSTGRES_* variables, then set the app’s database host to the PostgreSQL service name. The first-run wizard can also be completed with those database values. For SQLite, omit the external database service and use the image’s supported SQLite setup path; the official image documents its environment-variable configuration in the repository.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Start Nextcloud and check the containers
From the directory containing compose.yaml, start the services:
docker compose up -d
Check whether the containers are running and, if the site is not reachable, inspect the app’s startup output:
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
docker compose ps
docker compose logs -f app
With the example port mapping, open http://localhost:8080/ on the Docker host.
Complete the first-run setup
Create the administrator account in the Nextcloud setup page. If the image has not auto-configured the installation from environment variables, select the database that matches your Compose file and enter its credentials. In this MariaDB example, the database host is db, the database name and user are nextcloud, and the application password is the same value used in both services. For PostgreSQL, use the PostgreSQL service name and the matching POSTGRES_* values. The official image can auto-configure the wizard when all required environment variables are supplied; see the official image documentation.
Recommended Free Tools
Fix trusted-domain errors
Nextcloud rejects requests made through hostnames or addresses it does not trust. Add every address users will use—such as the LAN IP, DNS name, and public domain—to NEXTCLOUD_TRUSTED_DOMAINS in the Compose environment or to trusted_domains in config.php. The installation manual states: “All URLs used to access your Nextcloud server must be whitelisted in your config.php file, under the trusted_domains setting.” See the Nextcloud installation wizard documentation.
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
For example, if users will access the server as cloud.example.com as well as through localhost, include both names in the trusted-domain configuration. After changing the Compose environment, recreate the app container so it receives the updated value:
docker compose up -d
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Put HTTPS in front of internet access
The official Nextcloud Docker documentation says, “When you want to have your server reachable from the internet, adding HTTPS-encryption is mandatory!” Use a reverse proxy or another TLS-terminating web server to handle HTTPS and forward requests to the app. The Compose example above exposes plain HTTP on port 8080 and is not, by itself, an internet-ready TLS setup. See the official Docker documentation for deployment examples.
If you choose nextcloud:fpm instead of nextcloud:apache, add a separate web server such as Nginx: the FPM image does not serve static files on its own. The official repository’s FPM example includes an Nginx web service.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Back up and update deliberately
Back up both the Nextcloud data in /var/www/html and the database volume. Backing up only one leaves the deployment incomplete: the app files and uploaded data are in the Nextcloud volume, while the database has its own persistent directory. The official Docker guidance recommends persistent storage for upgrades and backups: Nextcloud Docker repository.
Keep the app and database image tags controlled rather than silently changing them during a maintenance window. Plan updates deliberately, and ensure current backups are available before making changes.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

