Here is a setup guide for Nextcloud All-in-One (AIO) on a bridged network behind a reverse proxy, along with other services like Pi-hole, Plex, and Caddy.
This guide uses the following services:
- Pi-hole: A local DNS server to manage internal network resolution.
- Nextcloud AIO: The all-in-one containerized Nextcloud instance.
- Caddy: A reverse proxy to handle SSL/TLS termination and route traffic to the correct services.
- Plex: A media server.
The suggested project file structure is as follows:
├── caddy
│ └── Caddyfile
├── docker-compose.yml
├── nextcloud
├── plex
└── etc-pihole
Before building your Docker containers, you must disable the service running on port 53 to allow Pi-hole to function as your DNS server.
- Stop the service:
sudo systemctl stop systemd-resolved
- Disable the service permanently:
sudo systemctl disable systemd-resolved
- Remove the symlink and create a new
resolv.conf
file:Add a public DNS server like Google's to the new file (e.g.,sudo rm /etc/resolv.conf sudo nano /etc/resolv.conf
nameserver 8.8.8.8
). - Verify port 53 is free:
You should see no output, indicating that no services are listening on these ports.
lsof -i tcp:53 lsof -i udp:53
With resolved
disabled, you can now build your Docker containers.
- Create your
docker-compose.yml
file: Define your services, networks, and volumes in this file. Ensure you configure the network settings correctly for a bridged network to allow communication between containers and with the host. BE SURE TO ADD A VALID ACCESS TOKEN TO PLEX SERVICE. - Build the containers:
This command builds and starts all the services defined in your
docker compose up -d
docker-compose.yml
file in detached mode.
Once the containers are running, you need to configure Pi-hole to handle DNS for your domain.
- Navigate to the Pi-hole admin interface: Access the web interface at
http://<your-host-machine-ip>/admin
. - Add a local DNS record: Go to Local DNS > DNS Records and add your Nextcloud domain. The domain should point to your host machine's IP address. For example:
- Domain:
nextcloud.yourdomain.com
- IP Address:
<your-host-machine-ip>
- Domain:
- Set your host's DNS: Change the DNS server on your host machine to its own IP address (
<your-host-machine-ip>
) to use Pi-hole for name resolution. Alternatively, you can configure your router to use the host's IP as its primary DNS. - Verify DNS resolution: Use
nslookup
to confirm your domain resolves correctly.The output should return your host machine's IP address.nslookup nextcloud.yourdomain.com
Now you can proceed with the Nextcloud AIO setup.
- Access the Nextcloud AIO installer: Navigate to the installer at
https://<your-host-machine-ip>:8080
. - Follow the setup instructions: The installer will guide you through the process, including setting up the domain and a reverse proxy. See Nextcloud AIO GitHub repository
- Troubleshooting: If the domain check fails, inspect the logs for both the
caddy
andnextcloud-aio-mastercontainer
services. A common issue is DNS misconfiguration or Caddy not properly communicating with the Nextcloud AIO Apache container.
Plex should be accessible:
** Setup Plex: ** http://localhost:32400/web brings you to plex.