diff --git a/site/docs/.vitepress/configs/locales/en.ts b/site/docs/.vitepress/configs/locales/en.ts index aafc5d91d..cb645d7db 100644 --- a/site/docs/.vitepress/configs/locales/en.ts +++ b/site/docs/.vitepress/configs/locales/en.ts @@ -406,6 +406,10 @@ const hostingTutorials = { text: "Heroku", link: "/hosting/heroku", }, + { + text: "exe.dev", + link: "/hosting/exe", + }, ], }; diff --git a/site/docs/hosting/comparison.md b/site/docs/hosting/comparison.md index cf7916203..a1a506692 100644 --- a/site/docs/hosting/comparison.md +++ b/site/docs/hosting/comparison.md @@ -64,15 +64,16 @@ On a VPS, you can run bots using both long polling or webhooks. Check out the [tutorial](./vps) on how to host grammY bots on a VPS. -| Name | Min. price | Ping to Bot API | Cheapest option | -| ------------- | ---------- | ----------------------------------------- | ---------------------------------- | -| Hostinger | $14 | | 1 vCPU, 4 GB RAM, 50 GB SSD, 1 TB | -| Contabo | | 15 ms :de: Nuremberg | | -| DigitalOcean | $5 | 1-15 ms :netherlands: AMS, 19 ms :de: FRA | 1 vCPU, 1 GB RAM, 25 GB SSD, 1 TB | -| Hetzner Cloud | €4.15 | ~42 ms :de: | 1 vCPU, 2 GB RAM, 20 GB SSD, 20 TB | -| IONOS VPS | €1 or $2 | 15 ms :de: Baden-Baden | 1 vCPU, 0.5 GB RAM, 8 GB SSD | -| Scaleway | €~7 | | 2 cores, 2 GB RAM, 20 GB SSD | -| MVPS | €4 | 6-9 ms :de: Germany | 1 core, 2 GB RAM, 25 GB SSD, 2 TB | +| Name | Min. price | Ping to Bot API | Cheapest option | +| ------------- | ---------- | ----------------------------------------- | ------------------------------------ | +| Hostinger | $14 | | 1 vCPU, 4 GB RAM, 50 GB SSD, 1 TB | +| Contabo | | 15 ms :de: Nuremberg | | +| DigitalOcean | $5 | 1-15 ms :netherlands: AMS, 19 ms :de: FRA | 1 vCPU, 1 GB RAM, 25 GB SSD, 1 TB | +| Hetzner Cloud | €4.15 | ~42 ms :de: | 1 vCPU, 2 GB RAM, 20 GB SSD, 20 TB | +| IONOS VPS | €1 or $2 | 15 ms :de: Baden-Baden | 1 vCPU, 0.5 GB RAM, 8 GB SSD | +| Scaleway | €~7 | | 2 cores, 2 GB RAM, 20 GB SSD | +| MVPS | €4 | 6-9 ms :de: Germany | 1 core, 2 GB RAM, 25 GB SSD, 2 TB | +| [exe.dev] | $20 | 150 ms :us: Boardman, Oregon | 2 CPUs, 8 GB RAM, 25 GB disk, 25 VMs | ## Unit Explanations diff --git a/site/docs/hosting/exe.md b/site/docs/hosting/exe.md new file mode 100644 index 000000000..5920d291d --- /dev/null +++ b/site/docs/hosting/exe.md @@ -0,0 +1,90 @@ +--- +prev: false +next: false +--- + +# Hosting: exe.dev + +[exe.dev](https://exe.dev) is a hosting platform that provides virtual machines with persistent disks, accessible over HTTPS. +It comes with [Shelley](https://exe.dev/docs/shelley/intro), a built-in AI coding agent that can set up and deploy your bot from a single prompt. + +## Quick Start + +1. Create a VM at [exe.dev](https://exe.dev). +2. Open Shelley at `https://.exe.xyz:9999/`. +3. Paste the prompt below and let Shelley do the rest. + +## Shelley Prompt + +You can use the following prompt for Shelley to set up a grammY bot on your VM automatically. +Adjust it to match your project (e.g. change the repo URL, runtime, or deployment type). + +### Long Polling + +```text +Clone my Telegram bot from into ~/bot. +Install Node.js via fnm, then run npm install in ~/bot. +Create a .env file at ~/bot/.env with BOT_TOKEN="". +Create a systemd service at /etc/systemd/system/bot.service that: + - sets WorkingDirectory to /home/exedev/bot + - loads EnvironmentFile from /home/exedev/bot/.env + - runs "node bot.js" + - restarts on failure +Enable and start the service. +Verify the bot is running with systemctl status bot. +``` + +Replace `` with your repository URL and `` with your bot token from [@BotFather](https://t.me/BotFather). + +### Webhooks + +exe.dev automatically proxies HTTPS traffic to your VM at `https://.exe.xyz/`. + +```text +Clone my Telegram bot from into ~/bot. +Install Node.js via fnm, then run npm install in ~/bot. +Create a .env file at ~/bot/.env with BOT_TOKEN="". +The bot uses webhooks with express on port 8000. +Create a systemd service at /etc/systemd/system/bot.service that: + - sets WorkingDirectory to /home/exedev/bot + - loads EnvironmentFile from /home/exedev/bot/.env + - runs "node bot.js" + - restarts on failure +Enable and start the service. +Run: ssh exe.dev share port 8000 +Run: ssh exe.dev share set-public +Set the Telegram webhook by opening: + https://api.telegram.org/bot/setWebhook?url=https://.exe.xyz/ +Verify the bot is running with systemctl status bot. +``` + +Replace ``, ``, and `` with your values. + +::: tip Deno +If your bot uses Deno, adjust the prompt accordingly: ask Shelley to install Deno instead of Node.js, and change the start command (e.g. `deno run --allow-net --allow-env mod.ts`). +::: + +## What Shelley Does + +When you give Shelley the prompt above, it will: + +1. Clone your bot's code onto the VM. +2. Install the runtime and dependencies. +3. Configure environment variables. +4. Create and start a systemd service to keep the bot running. +5. For webhooks: configure the exe.dev proxy and register the webhook URL with Telegram. + +No manual SSH, no configuration files to write—just one prompt. + +## Custom Domains + +You can point your own domain to your exe.dev VM. +TLS certificates are issued automatically. + +For a subdomain like `bot.example.com`, create a CNAME record: + +```text +bot.example.com CNAME .exe.xyz +``` + +For more details, see the [exe.dev documentation](https://exe.dev/docs/all).