{"id":22057159,"url":"https://github.com/goldstack/hetzner-vps-template","last_synced_at":"2025-03-23T16:23:16.024Z","repository":{"id":260069940,"uuid":"861095058","full_name":"goldstack/hetzner-vps-template","owner":"goldstack","description":"Starter template to develop Hetzner VPS with Terraform and deployment script","archived":false,"fork":false,"pushed_at":"2025-03-13T21:49:32.000Z","size":118913,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T22:31:54.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goldstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-22T01:40:04.000Z","updated_at":"2025-03-13T21:49:35.000Z","dependencies_parsed_at":"2025-02-21T21:54:51.506Z","dependency_job_id":null,"html_url":"https://github.com/goldstack/hetzner-vps-template","commit_stats":null,"previous_names":["goldstack/hetzner-vps-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fhetzner-vps-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fhetzner-vps-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fhetzner-vps-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fhetzner-vps-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldstack","download_url":"https://codeload.github.com/goldstack/hetzner-vps-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245129122,"owners_count":20565402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T16:16:47.314Z","updated_at":"2025-03-23T16:23:15.995Z","avatar_url":"https://github.com/goldstack.png","language":"HTML","readme":"\u003cp align=\"right\"\u003e\u003cimg src=\"https://cdn.goldstack.party/img/202203/goldstack_icon.png\" height=\"12\"\u003e Generated with \u003ca href=\"https://goldstack.party\"\u003eGoldstack\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://goldstack.party/templates/hetzner-vps\"\u003e\n    \u003cimg src=\"https://cdn.goldstack.party/img/202409/hetzner.svg\" height=\"80\"\u003e\n    \u003ch1 align=\"center\"\u003eStarter Template for Hetzner VPS\u003c/h1\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA starter template to define a [Hetzner](https://www.hetzner.com/) VPS from code using [Terraform](https://www.terraform.io/). Also supports scripts for easy deployment to the server.\n\nThis project has been automatically generated using the template:\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\n        \u003cp align=\"center\"\u003e\u003ca href=\"https://goldstack.party/templates/hetzner-vps\"\u003e\u003cimg width=\"50\" src=\"https://cdn.goldstack.party/img/202409/hetzner.svg\"\u003e\u003c/a\u003e\u003c/p\u003e\n        \u003cp\u003e\u003ca href=\"https://goldstack.party/templates/hetzner-vps\"\u003eHetzner VPS\u003c/a\u003e\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nFeel free to fork this repository and modify it for your needs, or use the [Goldstack project builder](https://goldstack.party/build) to generate a boilerplate specifically generated for your project.\n\n# Getting Started\n\nThank you for using this boilerplate. For any questions or feedback, please be welcome to [raise an issue on GitHub](https://github.com/goldstack/goldstack/issues) 🤗 .\n\n## 1. Fork and clone the repository\n\nFork this repository and then clone the fork into your local machine.\n\nFor more information, see [GitHub documentation - Fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo)\n\n## 2. Install required local dependencies\n\nA few dependencies need to be available in your development system. Please verify they are present or install them.\n\n- Node v20+\n- Yarn v1.22.5+\n- Docker v20+\n\nOpen a terminal and run the following commands:\n\n```bash\nnode -v\nyarn -v\ndocker --version\n```\n\nThis should produce the following output:\n\n![Confirming versions in the console](https://cdn.goldstack.party/img/202203/confirm_versions.png)\n\nIf you need to install or update any of the dependencies, please see the following guides:\n\n- [Downloading and installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)\n- [Yarn Installation](https://yarnpkg.com/getting-started/install)\n- [Install Docker for Windows](https://docs.docker.com/docker-for-windows/install/) / [Install Docker for Mac](https://docs.docker.com/docker-for-mac/install/)\n\n## 3. Initialise project and install NPM Dependencies\n\nRun `yarn` in your project directory to install and download all dependencies.\n\nThe installation process should take around 3-10 minutes depending on the dependencies that need to be downloaded.\n\n![Installing project dependencies](https://cdn.goldstack.party/img/202203/install_project.gif)\n\nYou can confirm everything was installed correctly by running `yarn -v`. This should show a yarn version of `3.0.0+`.\n\n![Confirming Yarn Version after install](https://cdn.goldstack.party/img/202203/confirm_yarn_version_after_install.png)\n\n## 4. Build modules\n\nMake sure that the project compiles correctly by running `yarn build` your project directory:\n\n![Building your project](https://cdn.goldstack.party/img/202203/build_project.gif)\n\nNote that this command also ensures that all TypeScript project references are configured correctly.\n\n## 5. Configure VSCode\n\nIn order to setup VSCode, open the project in VSCode.\n\nVSCode may prompt you to ask if you trust the authors of the workspace. Respond with Yes.\n\n\u003cimg src=\"https://cdn.goldstack.party/img/202201/trust_authors.png\" width=\"300\" alt=\"VSCode Prompt trust authors\"\u003e\n\nYou may also be asked if you want to install recommended extensions for this workspace. We recommend to do so since the template will be optimised to work with the suggested extensions.\n\n![VSCode Prompt install extensions](https://cdn.goldstack.party/img/202201/install_extensions.png)\n\nIf you want to install the necessary extensions manually, here are links to the extensions required:\n\n- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)\n- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)\n- [ZipFS](https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs) (optional)\n\n## 6. Initialise TypeScript\n\nLocate a `.ts` or `.tsx` file in the workspace and open it. When asked whether to use the workspace TypeScript version, click _Allow_.\n\n\u003cimg src=\"https://cdn.goldstack.party/img/202201/allow_typescript.gif\"  alt=\"VSCode Locate TypeScript\"\u003e\n\nIn the status bar on the bottom right-hand corner of the VSCode editor you should now see _TypeScript_.\n\n![TypeScript status icon in VSCode](https://cdn.goldstack.party/img/202203/typescript_init.png)\n\n## 7. Customise Configuration\n\nIn order to use this template for your own project, there are a few things to update.\n\nFirst, you need to create a file `config/infra/hetzner/config.json` to define your Hetzner token:\n\n```json\n{\n  \"users\": [\n    {\n      \"name\": \"[your user name]\",\n      \"config\": {\n        \"token\": \"[your token]\"\n      }\n    }\n  ]\n}\n```\n\nFind more information on this in [Hetzner Credentials](https://docs.goldstack.party/docs/templates/hetzner-vps#hetzner-credentials).\n\nThen you need to update the file `packages/hetzner-vps-1/goldstack.json`:\n\n```json\n{\n  \"$schema\": \"./schemas/package.schema.json\",\n  \"name\": \"hetzner-vps-1\",\n  \"template\": \"hetzner-vps\",\n  \"templateVersion\": \"0.1.0\",\n  \"configuration\": {},\n  \"deployments\": [\n    {\n      \"name\": \"prod\",\n      \"awsUser\": \"goldstack-dev\",\n      \"awsRegion\": \"us-west-2\",\n      \"hetznerUser\": \"local\",\n      \"configuration\": {\n        \"location\": \"hil\",\n        \"serverType\": \"cpx11\",\n        \"sshUserFingerprint\": \"49:35:14:98:08:d4:71:a6:04:c2:f6:73:f0:68:2d:5c\",\n        \"serverName\": \"goldstack-ci-test\",\n        \"environmentVariables\": [\n          {\n            \"name\": \"DUMMY_ENV\",\n            \"value\": \"I rock\"\n          },\n          {\n            \"name\": \"HTTP_PORT\",\n            \"value\": \"80\"\n          },\n          {\n            \"name\": \"HTTPS_PORT\",\n            \"value\": \"443\"\n          }\n        ]\n      },\n      \"tfStateKey\": \"hetzner-vps-1-prod-2d8c49d9d87e7c956e8e.tfstate\"\n    }\n  ]\n}\n```\n\nHere change the following:\n\n- _Delete_ the property `tfStateKey`\n- _Update_ the `hetznerUser` to the username you defined in `config.json` above\n- _Update_ the `sshUserFingerprint` to the fingerprint of an SSH user you have created through Hetzner console\n- _Update_ the `serverName` to a name of your choosing\n- _Update_ the `location` to what you require\n- _Update_ the `serverType` to what you require\n\nFind more information about the required values in [Hetzner VPS / Configure](https://docs.goldstack.party/docs/templates/hetzner-vps#configure).\n\nTo further define what you want to deploy to your server, start with the files in `packages/hetzner-vps-1/server`.\n\nFor instance, you can modify the `docker-compose.yml` file with what you require:\n\n```yml\nversion: '3.8'\n\nservices:\n  caddy:\n    image: caddy\n    container_name: caddy\n    ports:\n      - '${HTTP_PORT}:80'\n      - '${HTTPS_PORT}:443'\n    volumes:\n      - ./Caddyfile:/etc/caddy/Caddyfile\n      - ./site:/usr/share/caddy/site\n      - caddy_data:/data\n      - caddy_config:/config\n\nvolumes:\n  caddy_data:\n  caddy_config:\n```\n\nNote you can define the variables you require in `goldstack.json`. If you want to supply secrets, create a file `credentials.json` as described [here](https://docs.goldstack.party/docs/templates/hetzner-vps#secrets).\n\n## 8. Contribute to Goldstack\n\nHave questions or ideas or want to contribute to the project? Please head over to [github.com/goldstack/goldstack](https://github.com/goldstack/goldstack).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstack%2Fhetzner-vps-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldstack%2Fhetzner-vps-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstack%2Fhetzner-vps-template/lists"}