-
Notifications
You must be signed in to change notification settings - Fork 12
Hosting on your domain with HTTPS
This guide will show you how to use Caddy as a web server to host Blogo on a domain of your choice with automatic HTTPS. Before you begin, make sure you have the following:
- Docker installed on your server: https://docs.docker.com/engine/install/
- A registered domain name and access to its DNS settings
- A server with SSH access, and ports 80 and 443 open
Note
Since blogo is very lightweight, you can run it on a very cheap server.
First, point your domain to the IP address of your server. This is necessary for generating an SSL certificate automatically via Caddy.
Type | Host | Value |
---|---|---|
A | (SUB)DOMAIN | IP_ADDRESS |
This is an example DNS record. The host value should be set to either the root domain or a sub-domain. The value should be the IP address of your server.
Create a directory on your server to store Blogo's compose file and articles folder. Then, navigate into this directory and create a docker-compose.yml
file with the following content:
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:latest
container_name: caddy
ports:
- "80:80"
- "443:443"
networks:
- caddy
restart: unless-stopped
volumes:
- caddy_data:/data
- /var/run/docker.sock:/var/run/docker.sock:ro
blogo:
image: pluja/blogo:latest
container_name: blogo
restart: unless-stopped
networks:
- caddy
volumes:
- ./articles:/app/articles
environment:
# CONFIG
BLOGO_TITLE: Blogo
BLOGO_DESCRIPTION: A blog built with Blogo!
BLOGO_KEYWORDS: blog,open source
BLOGO_URL: REPLACE_WITH_YOUR_DOMAIN
#BLOGO_ANALYTICS: '<script defer src="https://my.analytics.site/script.js"></script>'
TIMEZONE: UTC
# NOSTR CONFIG
PUBLISH_TO_NOSTR: false
#NOSTR_NSEC: ""
#NOSTR_RELAYS: "wss://nostr-pub.wellorder.net,wss://relay.damus.io,wss://relay.nostr.band"
labels:
caddy: REPLACE_WITH_YOUR_DOMAIN
caddy.reverse_proxy: "{{upstreams 3000}}"
networks:
caddy:
name: caddy
volumes:
caddy_data:
Replace REPLACE_WITH_YOUR_DOMAIN
with the domain you have configured. This time, do not set the http
or https
prefix. Example value: blogo.example.com
Ensure that your domain's DNS settings have propagated by checking a site like DNS Checker.
Run the following command to start up your services:
docker compose up -d
Allow a few minutes for the SSL certificate to be created by Caddy. Then, you can access your Blogo instance at your domain.
You’ve now successfully hosted Blogo on your own domain using Docker and Caddy!