From a9aa903112e207a82169840b48ff1c21f7829d47 Mon Sep 17 00:00:00 2001 From: mattspeer Date: Sat, 20 Dec 2025 12:10:22 -0600 Subject: [PATCH] Upload files to "/" --- README.md | 37 +++++++++++++++++++++++++++++++++++++ docker-compose.yml | 14 ++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..a89e04c --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +Caddy is a reverse proxy that protects the self-hosted applications from being exposed directly to the internet. Caddy is the only application exposed, it accepts the network traffic and then passes that network traffic to the applications behind the firewall based on rules. Caddy also automatically generates SSL certificates that encrypts the network traffic between the client making the request and the application. + +# Installation + +Caddy is easy to install using Portainer using the following instructions. + +> [!Note] +> Both docker and Portainer must be installed, configured, and running first on the server. + +1. Open Portainer and create a new Stack. +2. Use "Caddy" for the name of the Stack +3. In the "Web Editor" field paste docker-compose.yml +4. Leave everything else as default and click the "Deploy the stack" button at the bottom of the page. + +# Restore the Configuration + +1. Create a page for how to connect to the server and link here, replacing steps 2-3 +2. Open a terminal window +3. Connect to the server using the following ssh command +``` bash +ssh mattspeer@192.168.4.20 +``` +3. Now that you are connected to the terminal of the server, issue the following command to edit the Caddyfile. This is how you configure Caddy. +``` bash +sudo nano /home/mattspeer/docker/caddy/Caddyfile +``` +4. Past the contents of the backup file. +5. Save and exit nano. +6. In order for the new configuration to be used, you must restart the Caddy container in Portainer. + +# Backup Caddy Configuration + +1. Connect to the server +2. Issue the following command to create a backup of Caddyfile configuration in the backup share. +``` bash +cp /home/mattspeer/docker/caddy/Caddyfile /mnt/5TB-Disk1/backup/server/caddy/ +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..134a0d6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.7" + +services: + caddy: + image: caddy:latest + container_name: caddy + restart: always + ports: + - "80:80" + - "443:443" + volumes: + - /home/mattspeer/docker/caddy/Caddyfile:/etc/caddy/Caddyfile + - /home/mattspeer/docker/caddy/caddy_data:/data + - /home/mattspeer/docker/caddy/caddy_config:/config