|
| 1 | +--- |
| 2 | +title: "Self Host on Railway" |
| 3 | +--- |
| 4 | + |
| 5 | +This guide will show you how to set up digger on [Railway](https://railway.com). |
| 6 | + |
| 7 | +This is a specific case of [Deploy as docker image](./deploy-docker). |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +1. Use the following template. It will create the Digger + PostgreSQL services and prepopulate many of the necessary environment variables. |
| 12 | + |
| 13 | + [](https://railway.com/deploy/VByV1N?referralCode=P06La2) |
| 14 | + |
| 15 | + 📢 DISCLOSURE: This template was created by [@sidpalas](https://github.com/sidpalas). He will recieve a (small) payment if you use it from the [Railway template kickback program](https://railway.com/open-source-kickback). |
| 16 | + |
| 17 | +2. Set your GitHub organization name (or username, if the repo you plan to use belongs to an individual user). |
| 18 | + |
| 19 | +  |
| 20 | + |
| 21 | +3. Deploy. |
| 22 | + |
| 23 | +4. Navigate to the pubilc domain for the Digger service (`Settings > Public Networking`). |
| 24 | + |
| 25 | +  |
| 26 | + |
| 27 | +5. Create the GitHub App |
| 28 | + |
| 29 | + Navigate to `your_digger_hostname/github/setup` and sign in with the `HTTP_BASIC_AUTH_USERNAME` and `HTTP_BASIC_AUTH_PASSWORD` values. |
| 30 | + |
| 31 | + These are geneated automatically by Railway when performing the initial deployment and can be retrieved from the `Variables` tab for the Digger service. |
| 32 | + |
| 33 | +  |
| 34 | + |
| 35 | +6. After creating the GitHub app, copy the provided values into their corresponding environment variables (overwriting the placeholder `REPLACE_ME_AFTER_GH_APP_CREATION` values): |
| 36 | + |
| 37 | + ```bash |
| 38 | + GITHUB_APP_ID= |
| 39 | + GITHUB_APP_CLIENT_ID= |
| 40 | + GITHUB_APP_CLIENT_SECRET= |
| 41 | + GITHUB_APP_PRIVATE_KEY_BASE64= |
| 42 | + GITHUB_WEBHOOK_SECRET= |
| 43 | + ``` |
| 44 | + |
| 45 | + 💡 **Tip:** When copying base64 values (e.g. the app key file), double clicking the text often does NOT select any trailing `=` characters. Make sure to copy them too! |
| 46 | + |
| 47 | +7. Redeploy. |
| 48 | + |
| 49 | +8. Create a PR to verify Digger is working properly. |
0 commit comments