# Setting up HTTPS

# Caddy

Caddy (opens new window) is a modern, open-source web server that simplifies the process of setting up and managing HTTPS. In this document, we'll guide you on how to use the Caddy Docker image to handle HTTPS with Ontopic Studio.

# Prerequisites

Before you begin, ensure that you have Docker installed on your system.

# Getting Started

  1. Pull the Caddy Docker Image

To get started, pull the official Caddy Docker image from Docker Hub:

docker pull caddy
  1. Create a Caddyfile

Create a file called Caddyfile (no extension) in your root directory. The Caddyfile is the configuration file for Caddy, where you can define your site configurations.

Here is a simple example:

yourdomain.com {
    header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    reverse_proxy 172.17.0.1:8081
}

Replace yourdomain.com with your actual domain and update the reverse_proxy directive with the address and port of Ontopic Studio.

If your server is not accessible from the Internet, more configuration is needed.

  1. Run the Caddy Docker Container

Run the Caddy Docker container with the following command:

docker run -v $(pwd)/Caddyfile:/etc/caddy/Caddyfile -p 80:80 -p 443:443 caddy

This command maps the current directory $(pwd) (where your Caddyfile is stored) to /etc/caddy/Caddyfile inside the container, exposes ports 80 and 443 for HTTP and HTTPS, and starts the Caddy server.

  1. Access Ontopic Studio

Visit Ontopic Studio in a web browser using the HTTPS protocol, and Caddy will automatically handle the TLS certificates for you.

# Customization

Caddy is highly customizable, and you can modify the Caddyfile to suit your specific needs. Refer to the Caddy documentation (opens new window) for more information.