# Production

Source: https://docs.anetos.dev/main/guides/production/

- [Deploy](https://docs.anetos.dev/main/guides/deployment/index.md): An Anetos app is one binary: the migrations, views, translations and static files are inside it. Deploying it is building it, giving it its settings, running its migrations, and keeping it running. This guide does that on a server with systemd and in a container; [Deploy to a cloud platform](https://docs.anetos.dev/main/guides/cloud-platforms/index.md) does it on Google Cloud Run, Azure Container Apps, Amazon ECS, DigitalOcean App Platform, Kubernetes, Fly.io and Render. The examples use an app called `blog`.
- [Deploy to a cloud platform](https://docs.anetos.dev/main/guides/cloud-platforms/index.md): Run the app's image on a platform that runs containers for you: Google Cloud Run, Azure Container Apps, Amazon ECS on Fargate, DigitalOcean App Platform, any Kubernetes cluster (GKE, EKS, AKS, DigitalOcean Kubernetes), Fly.io or Render. Each section deploys the same app, called `blog`: the web server, the background work (queue workers and the scheduler), the migrations before each new version, and a managed PostgreSQL database.
- [Find N+1 queries](https://docs.anetos.dev/main/guides/n-plus-one/index.md): An N+1 is a query in a loop: one query for a list of posts, then one per post for its author. It works, and it's fast with three posts in development; with three hundred in production, it isn't. Anetos warns when a request (or a job, a listener, a scheduled task) runs the same query many times, and says where, so you can load the rows in one query instead. The complete example is [`examples/database`](https://github.com/anetos-dev/anetos/tree/main/examples/database).
- [Secure your app](https://docs.anetos.dev/main/guides/security/index.md): Anetos starts safe: CSRF protection, encrypted session cookies, parameterized queries, escaped views, security headers, throttled logins. What it can't choose for you are the settings and the deployment (a key, HTTPS, the proxies to trust, the database's connection), and what only your code knows: who may read or change whose records. This guide covers what Anetos protects in each stack, the tools that check the rest, and the checklist before you go live.
- [Protect your app in the browser](https://docs.anetos.dev/main/guides/browser-security/index.md): A browser runs your pages' scripts, sends your cookies with every request to your site, and lets other sites' pages send requests to it too. Four things keep that safe: CSRF protection (other sites' pages can't act as your visitors), the CORS settings (which other sites' scripts may read your answers; by default, none), a Content-Security-Policy (scripts injected into a page don't run), and escaping (what users typed is shown as text, not run). This guide covers what each stack does by default and what you add, for pages in templ with htmx, in React, Vue or Svelte with Inertia, and for a single-page app that calls your API.
- [Check your app's security](https://docs.anetos.dev/main/guides/security-check/index.md): `security:check` checks your app against security rules: its code (SQL built from request data, a redirect to a URL from the request, a secret written in a file), its dependencies (known vulnerabilities, with govulncheck), its routes (a form's route without CSRF protection, an admin page anyone can open), its settings (session cookies sent over plain HTTP, mail in plain text) and, with `--url`, the running site (missing security headers, a `.env` served to anyone). Each finding says where it is (a line of your code, or a setting), why it matters and how to fix it. The report comes as text, JSON, SARIF (for GitHub's code scanning) or Markdown.
