---
title: "Hosting with Docker"
tags:
If you want to host Quartz on a specific machine, it may be easier to install Docker Compose and follow the instructions below (than to install Quartz's dependencies manually).
You can serve Quartz locally at http://localhost:1313 with the following script:
docker-compose.yml
```
services:
quartz-hugo:
image: ghcr.io/jackyzha0/quartz:hugo
container_name: quartz-hugo
volumes:
- /path/to/quartz:/quartz
ports:
- 1313:1313
# optional
environment:
- HUGO_BIND=0.0.0.0
- HUGO_BASEURL=http://localhost
- HUGO_PORT=1313
- HUGO_APPENDPORT=true
```
By default, the container will clone and serve github:jackyzha0/quartz. However, you can serve your own fork of quartz by cloning to the above /path/to/quartz directory.
Then run with: docker-compose up -d in the same directory as your docker-compose.yml file.
While the container is running, you can update their quartz fork with: docker exec -it quartz-hugo make update.
Assuming you are already familiar with port forwarding and setting it up with your router model:
HUGO_BASEURL=http://your-public-ip and then start your container.p to your-local-ip:1313.http://your-public-ip:p.However, your HTTP connection will be unencrypted and this method is not secure.
your-domain.com) from Cloudflare. Point a DNS A record from your-domain.com to your public IP address and enable the proxy.HUGO_BASEURL=https://your-domain.com, HUGO_PORT=443, and HUGO_APPENDPORT=false. Change 1313:1313 to 443:443 for the ports in docker-compose.yml.https://your-domain.com!If you want to serve more than just Quartz to the internet on this machine (or don't want to use the Cloudflare registrar and proxy), you should follow the steps in the section above (as appropriate) and also set up a reverse proxy, like Traefik. Be sure to configure your TLS certificates too!