+++
date = '2025-07-26T22:00:18Z'
draft = false
title = 'Self Hosting Hugo'
+++
## Why I Decided to Self-Host

I've been working on rockcampbell.com, and decided I wanted full control. That meant running Hugo on my own home server, behind Nginx Proxy Manager, using Docker — and pointing my domain directly to it.

What followed was a surprisingly long series of gotchas...

---

## Building the Hugo Site

- Used the PaperMod theme
- Installed Hugo Extended manually (because the Arch repo version was too old)
- Created my first post (and later deleted it)

---

## Docker Setup

- Used `nginx:alpine` to serve the public folder
- Mounted the `public/` folder using Docker Compose
- Exposed it to Nginx Proxy Manager via the shared `web` network

---

## Nginx Proxy Manager

- Configured the domain `rockcampbell.com`
- Issued SSL certificate via Let's Encrypt
- Initial requests worked, but subpages failed over HTTPS

**Fix:** The issue was a misconfigured `baseURL` in `hugo.toml`, and SSL wasn’t working until I reissued the cert.

---

## DNS Issues

I forgot to update the A record from GitHub Pages to my home IP, which caused Let's Encrypt cert issuance to fail.

---

## Hugo Errors

- `Error: no existing content directory configured for this project`  
  Fixed by adding `contentDir = "content"` to `hugo.toml`.

---

## Lessons Learned

- Always double-check DNS before attempting SSL
- If you get a 502 Bad Gateway from OpenResty, it’s probably a reverse proxy or Docker networking issue
- Don’t trust the default `hugo new` behavior with new module-based sites — clarify your config

---

## Final Setup

- Hugo serves from `/public`
- Docker container running on `web` network
- Nginx Proxy Manager handles SSL + reverse proxy
- rockcampbell.com is live and running from my home server
