# Guides by stack

> Every language, framework and kind of app with its guide and an example repository to start from.

Find the guide for the language, framework or kind of app you are deploying.
Each guide shows what to change in your project and the commands to deploy
it. Where a guide has an example repository, you can clone it and deploy it
as it is, or start from it as a template.

Every app on Gregale follows the same few rules: listen on `0.0.0.0` and the
port in `PORT`, keep state in a database or object storage, and answer a
health path such as `/healthz`. [Deploy a web framework](https://gregale.dev/docs/frameworks.md)
covers them once for every stack.

## By language and framework

### JavaScript and TypeScript

| Stack | Guide | Example repository |
| --- | --- | --- |
| Express, Fastify, Hono | [Deploy an Express app](https://gregale.dev/docs/deploy-express.md) | [node-api-worker](https://github.com/gregale-dev/node-api-worker) |
| NestJS | [Deploy a NestJS app](https://gregale.dev/docs/deploy-nestjs.md) | [nestjs-postgres](https://github.com/gregale-dev/nestjs-postgres) |
| Next.js | [Deploy a Next.js app](https://gregale.dev/docs/deploy-nextjs.md) | [nextjs-postgres-starter](https://github.com/gregale-dev/nextjs-postgres-starter) |
| Nuxt | [Deploy a Nuxt app](https://gregale.dev/docs/deploy-nuxt.md) | [nuxt-postgres](https://github.com/gregale-dev/nuxt-postgres) |
| SvelteKit | [Deploy a SvelteKit app](https://gregale.dev/docs/deploy-sveltekit.md) | [sveltekit-postgres](https://github.com/gregale-dev/sveltekit-postgres) |
| Bun | [Deploy a Bun app](https://gregale.dev/docs/deploy-bun.md) | [bun-hono-postgres-starter](https://github.com/gregale-dev/bun-hono-postgres-starter) |

### Python

| Stack | Guide | Example repository |
| --- | --- | --- |
| FastAPI | [Deploy a FastAPI app](https://gregale.dev/docs/deploy-fastapi.md) | [fastapi-postgres-jobs](https://github.com/gregale-dev/fastapi-postgres-jobs) |
| Django | [Deploy a Django app](https://gregale.dev/docs/deploy-django.md) | [django-postgres](https://github.com/gregale-dev/django-postgres) |
| Flask | [Deploy a Flask app](https://gregale.dev/docs/deploy-flask.md) | [flask-postgres](https://github.com/gregale-dev/flask-postgres) |
| AI agent behind an HTTP API | [Deploy an AI agent API](https://gregale.dev/docs/deploy-ai-agent.md) | [ai-agent-api](https://github.com/gregale-dev/ai-agent-api) |
| Streamlit | [Host a Streamlit app without sleeping](https://gregale.dev/articles/host-streamlit-app-without-sleeping) | [streamlit-dashboard](https://github.com/gregale-dev/streamlit-dashboard) |
| Gradio | [Deploy a web framework](https://gregale.dev/docs/frameworks.md) | [gradio-digits](https://github.com/gregale-dev/gradio-digits) |

### Other languages

| Stack | Guide | Starter |
| --- | --- | --- |
| Go (`net/http`, Gin) | [Deploy a Go app](https://gregale.dev/docs/deploy-go.md) | [go-postgres](https://github.com/gregale-dev/go-postgres) |
| Rust (Axum, Actix Web) | [Deploy a Rust app](https://gregale.dev/docs/deploy-rust.md) | [rust-axum-postgres](https://github.com/gregale-dev/rust-axum-postgres) |
| PHP (Laravel) | [Deploy a Laravel app](https://gregale.dev/docs/deploy-laravel.md) | [laravel-postgres](https://github.com/gregale-dev/laravel-postgres) |
| Java (Spring Boot) | [Deploy a Spring Boot app](https://gregale.dev/docs/deploy-spring-boot.md) | [spring-boot-postgres](https://github.com/gregale-dev/spring-boot-postgres) |
| C# (ASP.NET Core) | [Deploy an ASP.NET Core API with PostgreSQL](https://gregale.dev/docs/deploy-aspnet-core-postgres.md) | [Starter ZIP](https://gregale.dev/examples/aspnet-core-postgres.zip) |
| Ruby on Rails | [Deploy Rails with PostgreSQL](https://gregale.dev/articles/deploy-rails-postgres) | [rails-postgres](https://github.com/gregale-dev/rails-postgres) |
| Anything with a `Dockerfile` | [Container compatibility](https://gregale.dev/docs/container-compatibility.md) | |

Gregale builds Node, Python and Go from source with no `Dockerfile`. Every
other language deploys from a `Dockerfile` in the project root, and each
guide above includes one that works.

## By kind of app

| You are building | Start here | Example repository |
| --- | --- | --- |
| A REST or JSON API | [Deploy a web framework](https://gregale.dev/docs/frameworks.md) | |
| An API with a background worker | [Workers](https://github.com/poyrazK/faas/blob/main/docs/workers.md) | [node-api-worker](https://github.com/gregale-dev/node-api-worker) |
| Background jobs and queues | [Jobs](https://gregale.dev/docs/jobs.md) | [fastapi-postgres-jobs](https://github.com/gregale-dev/fastapi-postgres-jobs) |
| Scheduled tasks | [Cron jobs](https://gregale.dev/docs/crons.md) | [python-cron-postgres](https://github.com/gregale-dev/python-cron-postgres) |
| A Docker Compose project | [Multi-service apps](https://gregale.dev/docs/multi-service.md) | [node-api-worker](https://github.com/gregale-dev/node-api-worker) |
| An existing container image | [Container compatibility](https://gregale.dev/docs/container-compatibility.md) | |
| A remote MCP server | [Host an MCP server](https://gregale.dev/docs/mcp-hosting.md) | [mcp-server-node](https://github.com/gregale-dev/mcp-server-node), [mcp-server-python](https://github.com/gregale-dev/mcp-server-python), [mcp-server-go](https://github.com/gregale-dev/mcp-server-go), [mcp-server-typescript-oauth](https://github.com/gregale-dev/mcp-server-typescript-oauth) |
| An AI agent or LLM app | [Deploy an AI agent API](https://gregale.dev/docs/deploy-ai-agent.md) | [ai-agent-api](https://github.com/gregale-dev/ai-agent-api) |
| Webhook receivers | [Inbound webhooks](https://gregale.dev/docs/inbound-webhooks.md) | [durable-stripe-webhooks](https://github.com/gregale-dev/durable-stripe-webhooks) |
| WebSockets or Server-Sent Events | [Managed realtime](https://gregale.dev/docs/realtime.md) | [scale-to-zero-websockets](https://github.com/gregale-dev/scale-to-zero-websockets) |
| A Discord bot | [Discord interactions endpoint](https://gregale.dev/articles/discord-bot-interactions-endpoint-serverless) | [discord-bot-interactions](https://github.com/gregale-dev/discord-bot-interactions) |
| A Telegram bot | [Telegram bot webhook](https://gregale.dev/articles/telegram-bot-webhook-scale-to-zero) | [telegram-bot-webhook](https://github.com/gregale-dev/telegram-bot-webhook) |
| A Slack app | [Slack Bolt in HTTP mode](https://gregale.dev/articles/slack-bolt-http-mode-scale-to-zero) | [slack-bolt-http](https://github.com/gregale-dev/slack-bolt-http) |
| Rate limits and bot protection | [Edge rules](https://gregale.dev/docs/edge-rules.md) | [edge-waf-rate-limit-starter](https://github.com/gregale-dev/edge-waf-rate-limit-starter) |

## Moving from another platform

- [Migrate from Heroku](https://gregale.dev/docs/migrate-from-heroku.md)
- [Migrate from Render](https://gregale.dev/docs/migrate-from-render.md)
- [Migrate from Railway](https://gregale.dev/docs/migrate-from-railway.md)
- [Migrate from Fly.io](https://gregale.dev/docs/migrate-from-fly.md)

## Your stack is not listed

If it runs on Linux and serves HTTP, it runs on Gregale. Write a
`Dockerfile` that starts the server on `0.0.0.0:$PORT`, then check it before
anything is uploaded:

```bash
gregale deploy --dry-run
```

See [Container compatibility](https://gregale.dev/docs/container-compatibility.md) for what an image
needs, and [Troubleshoot deploys](https://gregale.dev/docs/troubleshooting.md) if the first
deploy fails.

Source: https://gregale.dev/docs/stacks
