Skip to content

A simple and production-ready Docker Compose setup for self-hosting the Caddy web server. It's pre-configured for easy use and can be integrated with other services on a shared network.

License

Notifications You must be signed in to change notification settings

AiratTop/caddy-self-hosted

Caddy Self-Hosted with Docker

caddy-self-hosted

This repository provides a docker-compose setup to run a self-hosted Caddy reverse proxy.

It is configured to connect to a shared Docker network, allowing easy integration with other services like n8n.

Features

  • Uses the official Caddy Docker image.
  • Automatic HTTPS via Let's Encrypt.
  • Data is persisted in a local volume.
  • Pre-configured for a shared network.
  • Includes scripts for easy management.

Getting Started

  1. Clone the repository:

    git clone https://github.com/AiratTop/caddy-self-hosted.git
    cd caddy-self-hosted
  2. Create the shared network: If you haven't already, create the shared Docker network:

    docker network create shared_network
  3. Set your domain: Edit the .env file and set DOMAIN_NAME to your primary domain (for example, DOMAIN_NAME=example.com) and SSL_EMAIL.

  4. Configure Caddyfile: Open the config/Caddyfile file and adjust any reverse-proxy blocks you need.

  5. Start the service:

    docker compose up -d

Usage

  • Start: docker compose up -d
  • Stop: docker compose down
  • Restart: ./restart-docker.sh
  • Update: ./update-docker.sh (Pulls the latest Docker image and restarts)

Connecting with other services

This setup is designed to work with other services on the shared_network. To add a new service, add a new block to the Caddyfile in the config directory.

See Also

Check out other self-hosted solutions:

License

This project is licensed under the MIT License - see the LICENSE file for details.


Author

AiratTop

About

A simple and production-ready Docker Compose setup for self-hosting the Caddy web server. It's pre-configured for easy use and can be integrated with other services on a shared network.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project