| 1 | # vinext on Hetzner |
| 2 | |
| 3 | Deploy a vinext App Router application with `Hetzner.Website.Vinext`. |
| 4 | Production uses vinext's production Node server in a systemd service on a Hetzner server. |
| 5 | |
| 6 | ```typescript |
| 7 | const site = yield* Hetzner.Website.Vinext("Web", { |
| 8 | env: { GREETING: "Hello from vinext on Hetzner!" }, |
| 9 | }); |
| 10 | ``` |
| 11 | |
| 12 | The example includes client hydration, Home/ISR navigation, an environment-aware |
| 13 | `/api/hello?name=Alchemy` endpoint, ISR, and public assets. |
| 14 | The default cache is process-local. Configure a shared Redis store through `env.REDIS_URL` for persistence across restarts and replicas. |
| 15 | Alchemy injects the cache adapter automatically. Keep ordinary `vinext()` |
| 16 | configuration in Vite; configure deployment on `Website.Vinext`. |
| 17 | |
| 18 | ## Run locally |
| 19 | |
| 20 | ```sh |
| 21 | bun install |
| 22 | bun alchemy dev |
| 23 | ``` |
| 24 | |
| 25 | The Website runs native `vinext dev` with hot reload and creates no cloud |
| 26 | resources. Apply `Alchemy.remote()` to deploy live during development. |
| 27 | |
| 28 | ## Deploy |
| 29 | |
| 30 | Configure [Hetzner credentials](https://alchemy.run/hetzner/setup), then run: |
| 31 | |
| 32 | ```sh |
| 33 | bun alchemy deploy |
| 34 | ``` |
| 35 | |
| 36 | Shared props are `rootDir`, `env`, `memo`, `assets`, `dev`, and `domain`. |
| 37 | Hetzner additionally requires `zone` for custom domains. The integration |
| 38 | package must be installed in the application; it is loaded at build time. |
| 39 | |
| 40 | ## Test and clean up |
| 41 | |
| 42 | ```sh |
| 43 | bun test test/dev.test.ts |
| 44 | ALCHEMY_PROFILE=testing bun test test/integ.test.ts |
| 45 | bun alchemy destroy |
| 46 | ``` |
| 47 | |
| 48 | The live suite destroys its previous stack before deploying and cleans up |
| 49 | afterward. See the [vinext guide](https://alchemy.run/hetzner/frontend/vinext). |