# Deploy Astro

> Deploy an Astro (SSR) app on Ownkube: push your repo for a live URL with automatic TLS, managed Postgres, and env vars included.

Deploy an [Astro](https://astro.build/) site on Ownkube in minutes. Push your repo and Ownkube builds it and ships it, and you get a live URL with automatic TLS. Managed Postgres, logs, metrics, and one-click rollbacks come built in. No cloud account to start.

## What you'll need

- An [Astro](https://astro.build/) site in a GitHub or GitLab repository
- About five minutes

No card required to sign in and look around. To deploy, top up the wallet from \$5 with no subscription, or pick a plan from \$5 / month. See [Pricing](/docs/billing/plans).

### Fully static sites

If your site has no server-rendered routes, you don't need a server process at all. Keep `output: 'static'` and Ownkube deploys it as a static build, no port to configure.

## Deploy it

1. **Connect your repo**

   Sign in at [app.ownkube.io/login](https://app.ownkube.io/login), open [**Settings**](https://app.ownkube.io/dashboard/settings), and connect the GitHub App (or GitLab) so Ownkube can reach your repository. Already have a prebuilt image in a registry? Point Ownkube at it instead. See [Registries](/docs/deployments/builds).

2. **Create a Web deployment**

   From your [dashboard](https://app.ownkube.io/dashboard), choose **Create deployment**, pick **Web**, and select your Astro repo. Ownkube builds it and pushes the image to a registry it manages for you.

3. **Set the port**

   For server-rendered routes, add the Node adapter (`@astrojs/node`) and set the port to **4321**, its default, with `HOST=0.0.0.0` so it's reachable. Fully static sites (`output: 'static'`) skip this step entirely, there's no port to configure. You can change it later in Settings.

4. **Add environment variables**

   Add any `KEY=value` pairs your app reads, and mark secrets with the **Secret** toggle. See [Environment variables](/docs/deployments/variables).

5. **Deploy**

   Click **Create deployment**. The deployment page streams the build, then startup and health checks. When the status goes **healthy**, open the generated hostname on the Overview tab. Your Astro site is live, with TLS included.

## Notes for Astro

### SSR vs static

Add the Node adapter (`@astrojs/node`) for server-rendered routes, or leave `output: 'static'` for a fully static build.

### Port 4321, HOST=0.0.0.0

The Node adapter's standalone server listens on 4321 and honors `HOST`/`PORT`. Set `HOST=0.0.0.0` so it's reachable, and set 4321 as the port in Ownkube.

### Static output option

A pure static build has no server to keep alive and no port to configure, it just serves files.

### Bring your own Dockerfile

Want full control of the build? Add a `Dockerfile` to your repo and Ownkube uses it, reading the port from its `EXPOSE` line.

## Add a database

Need Postgres? Add a **Database** in one click and Ownkube injects the connection string as `DATABASE_URL` (plus `PGHOST`, `PGUSER`, and friends) into your app. See [Databases](/docs/data/postgres).

## Scale and observe

Once you're running, the app [scales within your plan's size](/docs/deployments/autoscaling) automatically, watch [logs and metrics](/docs/observability) on every deployment, and roll back a bad deploy in one click.

- [Quickstart](/docs/quickstart)
- [Scaling](/docs/deployments/autoscaling)

---

**Don't see a feature you need?** Email [support@ownkube.io](mailto:support@ownkube.io?subject=Feature%20request). Ownkube is shaped by the teams using it and we ship what our users ask for.

## Search

This site has a search endpoint: https://context7.com/api/v2/ask?siteKey=ask_c64dfe8ffaa8d3ad19576838&query=<URL-encoded question>. It returns documentation that answers the question, with a source link for each part. No API key is needed. If nothing matches, it says so.
