TLDR: I consistently fail to set up Nextcloud on Docker. Halp pls?

Hi all - please help out a fellow self-hoster, if you have experience with Nextcloud. I have tried several approaches but I fail at various steps. Rather than describe my woes, I hope that I could get a “known good” configuration from the community?

What I have:

  • a homelab server and a NAS, wired to a dedicated switch using priority ports.
  • the server is running Linux, Docker, and NPM proxy which takes care of domains and SSL certs.

What I want:

  • a docker-compose.yml that sets up Nextcloud without SSL. Just that.
  • ideally but optionally, the compose file might include Nextcloud office-components and other neat additions that you have found useful.

Your comments, ideas, and other input will be much appreciated!!

@aliens@infosec.pub
link
fedilink
English
71Y

Here’s my docker-compose.yml for nextcloud (with minor privacy changes) that includes onlyoffice and drawio containers. SSL is not included and should be handled by NPM and you’ll need a proxy host for both drawio and onlyoffice. I use NPM in docker so I just add it to the docs network instead of exposing any additional ports. For onlyoffice the secret key gets regenerated each time the container starts so you’ll need to update onlyoffice setting in nextcloud each time (unless someone has a better solution). You can get the secret key by logging into the onlyoffice container and running

cat /etc/onlyoffice/documentserver-example/local.json

I’ve been running this solution for a few years without any major issues.

docker-compose.yml

version: '3.5'

networks:
 docs:
  name: docs 
  driver: bridge

services:
 nextcloud:
  image: linuxserver/nextcloud
  container_name: nextcloud
  environment:
   - PUID=1000
   - PGID=1000
   - MYSQL_DATABASE=nextcloud
   - MYSQL_USER=nextcloud
   - MYSQL_PASSWORD=P@ssWord321!
   - MYSQL_HOST=nextcloud_db
   - TZ="America/Chicago"
  volumes:
   - /home/user/docker/configs/nextcloud:/config
   - /home/user/docker/configs/nextcloud_data:/data
  restart: unless-stopped
  depends_on:
   - nextcloud_db
  networks:
   - docs 

 nextcloud_db:
  image: linuxserver/mariadb:110.4.21mariabionic-ls31
  container_name: nextcloud_db
  restart: always
  environment:
   - PUID=1000
   - PGID=1000
   - MYSQL_ROOT_PASSWORD=P@ssWord123!
   - MYSQL_DATABASE=nextcloud
   - MYSQL_USER=nextcloud
   - MYSQL_PASSWORD=P@ssWord321!
  volumes:
   - /home/user/docker/configs/nextcloud_db/mysql:/config
  restart: unless-stopped
  networks:
   - docs 

 onlyoffice:
  image: onlyoffice/documentserver
  container_name: onlyoffice
  restart: always
  depends_on:
   - nextcloud
  networks:
   - docs 

 image-export:
  image: jgraph/export-server
  container_name: nextcloud-drawio-export
  networks:
   - docs 
  volumes:
   - ./fonts:/usr/share/fonts/drawio
  restart: unless-stopped

 drawio:
  image: jgraph/drawio
  container_name: nextcloud-drawio
  networks:
   - docs 
  depends_on:
   - image-export
  environment:
   - VIRTUAL_HOST=drawio.example.com
   - VIRTUAL_PORT=8080
   - EXPORT_URL=http://image-export:8000/
  restart: unless-stopped
30021190
link
fedilink
English
21Y

This compose looks like it should work, I’m not at a pc to test but it’s near identical to my own; I would maybe change onlyoffice for collabra otherwise try this.

Op states they are using a Nas and server, so if NFS is being used you may need :Z on the end of any kind volume (or a non-NFS mount point if using podman/extended ACLS don’t work).

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 127 users / day
  • 422 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog