https://github.com/eckhardt-d/nuxt-hetzner
Self-hosted Nuxt on Hetzner with SST, Caddy and Cloudflare
https://github.com/eckhardt-d/nuxt-hetzner
caddyserver cloud nuxt self-host
Last synced: about 1 year ago
JSON representation
Self-hosted Nuxt on Hetzner with SST, Caddy and Cloudflare
- Host: GitHub
- URL: https://github.com/eckhardt-d/nuxt-hetzner
- Owner: Eckhardt-D
- Created: 2024-10-18T09:55:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-19T04:25:56.000Z (over 1 year ago)
- Last Synced: 2025-04-30T03:49:34.129Z (about 1 year ago)
- Topics: caddyserver, cloud, nuxt, self-host
- Language: TypeScript
- Homepage:
- Size: 103 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nuxt on Hetzner with SST, Caddy and Cloudflare
This is just a simple starter to deploy your [Nuxt](https://nuxt.com) app on a [Hetzner Cloud](https://www.hetzner.com/cloud) server.
## Getting started
You will need:
- Hetzner Cloud account & create and API Token
- CloudFlare Account & create 2 API Tokens:
1. One with `DNS::edit` permissions on a specific zone
2. One with `Zone::read` permissions on all zones
- You will also need to get your CloudFlare Zone ID and Account ID for the env vars
## Setup
1. Clone this repo
git clone https://github.com/Eckhardt-D/nuxt-hetzner.git
2. Install dependencies
cd nuxt-hetzner && bun install
3. Copy the .env.example file to .env and fill in the required values
cp .env.example .env
4. Edit your app in `./nuxt` folder (you will have to install these deps too)
5. Run the deploy script
bun run deploy
## What happens?
The deploy script is pretty self-explanatory in the `sst.config.ts` file on what it creates. But in short:
- It creates a new Hetzner Cloud server
- It creates a new CloudFlare DNS record
- It builds and runs Nuxt in a docker container
- It sets up a reverse proxy with Caddy in a different container that points to nuxt
## Delete everything
bunx sst remove --stage=production
## NB
This was just an experiment on self-hosting Nuxt with SST. There may be bugs or limitations. Feel free to fork and improve it.