Hey everyone! I'm in the process of setting up Nextcloud to host my files and share them publicly with friends. To make this work safely, I need to secure my homelab first. I've read that I should close certain ports and change default ones like 443 to something like 8443. However, I'm a bit lost on how to access and modify the configuration files of the Docker-hosted service. Do I really need to pull the image, configure it, and redeploy each time I want to make a change, or is there a better approach?
2 Answers
You're right about needing to secure things. If you're hosting Docker containers, using a reverse proxy is a great approach. There are various guides out there on this topic. For example, you can start with something like Traefik or Nginx, which really simplify port management and security. And if you're using Docker Compose, just edit the `docker-compose.yml` file to change the port mappings, then run `docker-compose up -d` to apply the changes without pulling a new image.
If you're looking for a straightforward solution and you're using the official Nextcloud all-in-one container, you might want to check out the guides on their blog. Generally, switching ports is a way to run multiple services on standard ports like 80 and 443 using a reverse proxy. For example, you'd route internet traffic on port 443 to a reverse proxy port such as 8443 for Nextcloud.
Actually, it's important to note that 'hosting dockers' isn't quite the right term. Docker refers to the container engine. What you're really doing is running containers based on images.