How do environment variables work?
Environment variables are the settings and secrets your app reads, such as API keys and database addresses. You set them for each site in the dashboard, and your app can read them both while it builds and while it runs.
Add them one at a time or paste a whole .env file. Saving one variable never touches the others.
Choose Save & Redeploy to apply a change. This matters for Next.js: values whose names start with NEXT_PUBLIC_ are written into the app when it builds, so changing one needs a fresh build.
If you deploy with your own Dockerfile, values the build itself needs go in the build arguments setting, and environment variables reach the running app.
Attach a managed database to the site and the dashboard offers to fill in DATABASE_URL, REDIS_URL or CLICKHOUSE_URL for you. You can export all your variables as a .env file at any time.
Related questions
Can I deploy a Next.js app automatically from GitHub?
Yes. Connect your GitHub repository once, and every push to your chosen branch builds and deploys your Next.js app automatically. It works on every paid plan, from Starter at £12 a month.
Full answerHow much does a PostgreSQL database cost?
£6 a month for each GB of memory the database has, starting at £6 a month for 1 GB. A standby copy that takes over if the database fails doubles the price. It is the same on every paid plan.
Full answerHow does git deployment work?
Connect a GitHub, GitLab or Bitbucket repository and choose a branch. Each push to that branch builds and deploys your app, with the build log shown live in the dashboard.
Full answerWhat databases are available?
Every site gets its own MySQL database, included in your plan and never shared with another site. On any paid plan you can also add managed PostgreSQL, Redis and ClickHouse databases, from £6 a month each.
Full answer