anfra docsAlpha
Self-hostCloud providers

Self-host on Render

Self-host anfra on Render as a Docker web service.

Set up with a coding agent

Paste this prompt into your coding agent, and it helps you set this up.
Self-host this anfra project on Render. Follow https://anfra.ai/docs/self-host/render.md. Do the steps you can, and tell me which ones I need to do.

You need your project on GitHub (how) and a Render account. If an organization owns the repo, one of its owners may need to approve Render's GitHub app.

1. Add a Dockerfile to your project

From your project's folder, run:

curl -fsSL -O https://raw.githubusercontent.com/holistics/anfra-hosting/main/Dockerfile \
  -O https://raw.githubusercontent.com/holistics/anfra-hosting/main/.dockerignore
git add Dockerfile .dockerignore
git commit -m "Add Dockerfile"
git push

2. Create the service

In the Render dashboard, click New > Web Service, choose Git Provider, and select your project's repo. Fill in the form:

  • Language: Docker

  • Environment Variables: in KEY, type LOGIN_USERS. In VALUE, type a name and password for each person who can sign in, as name:password, separated by commas. Include one for agent: your coding agent signs in with it in step 4. For example:

    maria:a-long-password,agent:another-long-password

    To let people sign in with Google or GitHub instead, or to use your own login such as Tailscale or Cloudflare Access, see Authentication.

  • Advanced > Secret Files: click Add Secret File, name it data_sources.yml, and paste the contents of your .anfra/data_sources.yml.

Your database credentials

Git leaves .anfra/data_sources.yml out, so the secret file is how Render gets your database credentials. Skip it if your project only uses a DuckDB file in the repo.

Click Deploy web service. The first deploy takes a few minutes. After that, every push to your repo deploys again.

3. Check that it works

When the deploy finishes, open the address at the top of the service's page, https://<name>.onrender.com. You see a login page. Sign in with a user from LOGIN_USERS, and open one of your Data Apps: it shows your data.

If the deploy fails, open Logs. The last line starting with start.sh: says what to fix, see Troubleshooting. If your apps show errors instead of data, anfra can't reach your database: check the secret file data_sources.yml, and if your database only accepts known IP addresses, allow Render's outbound IP addresses.

4. Connect your coding agent

In Claude Code, with your address and the agent user's password:

claude mcp add --transport http anfra https://<name>.onrender.com/mcp \
  --header "Authorization: Basic $(printf 'agent:<agent-password>' | base64 | tr -d '\n')"

Ask it to list your datasets and run a small query. For other agents, see Coding agents with MCP.

Updates

Your anfra project

When you change your project, such as a new or edited Data App, model or dataset, commit it and push it:

git add .
git commit -m "Add the sales dashboard"
git push

Render deploys it on its own, within a few minutes.

anfra

Your Dockerfile pins the anfra version. To move to the latest one, download it again from your project's folder, and push it:

curl -fsSL -O https://raw.githubusercontent.com/holistics/anfra-hosting/main/Dockerfile
git add Dockerfile
git commit -m "Update anfra"
git push

It deploys like any change to your project. Run anfra update too, so your CLI matches.

On this page