Database users, roles and privileges for Metabase

Metabase needs a database user for queries and, when you add transforms, uploads, actions or model persistence, separate write paths. This page explains how to split those privileges so the main connection stays read-only.

On this page

Why Metabase database users and privileges need a deliberate design

Any team connecting Metabase to a production database or warehouse needs to decide, before the first sync, what Metabase is allowed to do in that database. The short answer: create a dedicated read-only database user with minimum privileges for querying, and keep every write feature on separate roles or a separate writable connection. Metabase's documentation recommends a read-only user that holds CONNECT plus SELECT only on the schemas and tables the dashboards actually use. Write features such as transforms, CSV uploads, actions and model persistence should never run through that same login.

The reason is that Metabase's own permissions operate inside Metabase. Data permissions, collection access and group settings decide what a person sees in the application, but they do not limit what the database login can do if a query, an admin setting or a misconfigured connection reaches further than intended. Keeping the main connection read-only at the database level means a mistake in Metabase cannot change source data through that connection. Teams should list each schema and table their questions and models depend on, then grant only those, and confirm the grants with a test login before connecting Metabase.

This is needed for most production connections and it is independent of the Metabase plan tier. Open source, Starter, Pro and Enterprise deployments all connect to databases the same way, so the read-only user and write-role separation apply regardless of which edition you run. Ask your database administrator to confirm how your engine expresses CONNECT and SELECT grants, and check the Metabase database users documentation for the current recommended setup before you write the grants.

Which database user pattern fits each Metabase write feature

This table compares the main read-only query user with separate write roles for transforms, uploads, actions and model persistence, plus a writable connection on a replica or separate database. Read each row as a question of where writes land and which connection carries them. The main takeaway is that the query connection should stay read-only, and each write feature should get its own identity with only the privileges that feature needs.

PatternWhat it is forPrivileges needed in principleWhen it fits
Read-only query userPowers the main connection that people query for saved questions and dashboardsCONNECT plus SELECT on the schemas and tables in use, nothing elseEvery Metabase database connection, as the default starting point
Transforms roleLets Metabase write transformed tables back to the databaseCONNECT plus privileges to create and write the target tables in one designated schemaWhen transforms need to persist results and you want writes kept off the query user
Uploads roleLets users load CSV files into new or existing tablesPrivileges to create tables and insert rows in a designated upload schemaWhen business users upload files and you want uploads isolated from production tables
Actions roleLets actions run write statements such as inserts or updatesOnly the specific INSERT, UPDATE or DELETE rights the approved actions requireWhen actions change records and you want each change limited to named tables
Model persistence roleStores persisted model tables in a schema Metabase managesPrivileges to create and refresh tables in one dedicated schemaWhen models are slow and you want cached copies kept in a separate schema
Writable connection on a read replica or separate databaseKeeps the main connection read-only while writes go through a second connectionWrite privileges on the writable target only, with the main connection holding read-only rightsWhen the source is a read replica or write load must stay away from the query database; requires the Advanced transforms add-on
Writable connection on a separate databaseRoutes writes to a different database than the one people queryWrite rights on the separate database; the main connection stays read-onlyWhen write targets should be physically or logically separate from governed data

Creating the read-only Metabase user and separate write roles

This sequence gives Metabase a read-only database login limited to the data people query, then adds separate write paths only for the features that need them. Each step ends with a check so you can confirm the boundary holds before users arrive.

  1. Confirm the schemas and tables people query

    Before creating any database role, list the schemas, tables and views that Metabase users will read, and note which features you plan to enable, such as transforms, CSV uploads, actions or model persistence. Your data owners and the analysts who will build questions should sign off on this list, since it defines the grant scope for the rest of the sequence. The step is done when you have a written inventory that separates read sources from any table a write feature will touch. Confirm with your DBA which objects contain sensitive columns that may need to stay out of the grant list.

  2. Create a dedicated read-only database role

    Create a database login that belongs to no one's personal account and holds only the privileges Metabase needs to read: CONNECT on the database and SELECT on the schemas and tables from the inventory. Do not grant ownership, schema-wide write rights or superuser status. Use your database's native role tooling and keep the password in your secrets manager. The step is done when the role exists and the grant listing matches the inventory exactly, with no extra tables or write privileges. Exact commands vary by database engine, so follow the Metabase docs on database users, roles and privileges for the steps specific to your engine.

  3. Connect Metabase with the read-only user

    In the Metabase admin settings, add the database connection using the read-only role and run the connection test. Then let the initial schema sync complete and run a saved question against each table in scope. This confirms that Metabase can read metadata and data with only the granted privileges. The step is done when the connection test passes, sync finishes, and sample queries return rows. If sync reports missing tables, correct the grant list rather than adding write privileges, because the fix is almost always a missing SELECT on a specific object.

  4. Verify the read-only user cannot write

    Test the boundary directly. From a database client, connect as the read-only role and attempt a harmless INSERT, UPDATE or DELETE against a test table in scope. The database should deny the statement with a permission error. Then confirm that Metabase still syncs and runs queries after the denial test. The step is done when the write attempt is refused, the denial is recorded in your database logs if logging is enabled, and Metabase remains fully functional for read queries. Keep this test in your runbook so it can be repeated after any grant change.

  5. Decide the write path for each enabled feature

    For each write-dependent feature from your inventory, decide whether it will use a separate database role on the same database or a writable connection that points to a different database or replica. Transforms, CSV uploads, actions and model persistence each write data, so each needs a documented owner and target schema. Writing these decisions down also shows auditors which identities can write and where. The step is done when you have one row per feature naming its role or connection, target location and approving owner. Check the Metabase docs on writable connections, which note that the Advanced transforms add-on is required for that setup.

  6. Create one write role per enabled feature

    Create a separate database role for each write feature in your decision list, granting only the write privileges that feature needs on its target schema. Keep these roles separate from the read-only role so that a compromised write credential does not expand read access. Store each password in your secrets manager. The step is done when each role's grants match its row in the decision list and no write role can reach schemas outside its target. Confirm the exact grant statements in the Metabase docs for database users, roles and privileges.

  7. Configure writable connections and retest

    If you chose a writable connection, add it in Metabase with its own credentials while keeping the main connection on the read-only role, especially if that main connection points to a read replica. Then rerun the denied-write test on the main connection and confirm that feature writes succeed only through the writable path. Check that sync and read queries still work on the main connection. The step is done when the main connection refuses writes, each enabled feature writes to its intended target, and the results are recorded for your change log. Repeat this retest after every grant change or feature addition.

How a writable connection keeps the main connection read-only

A writable connection lets you keep the connection that answers everyday questions read-only while still allowing Metabase to write. The main connection points at a user with CONNECT and SELECT privileges, and it can sit on a read replica or on a database role with no write grants at all. Transforms and CSV uploads then go through a separate writable connection, which uses its own user and, where practical, its own database or schema. The effect is that a mistake in a saved question, an action or a transform cannot change the data that most people query, because the credentials used for normal browsing have no write path. Confirm in the Metabase writable connection documentation how the writable connection is configured in your version, since the setup steps and the points where Metabase switches between connections should be checked against the release you plan to run.

The pattern has costs you should plan for. Writable connections require the Advanced transforms add-on, which is a paid feature, so the licensing decision comes before the architecture. If the read-only connection is a read replica, writes land on a different target, and the data in the replica can trail the primary and any writable target by the replication lag your database platform allows. Dashboards that combine a transform output with replica data may therefore show values that were not yet visible to the reader a moment earlier. Ask your database team to measure and document replication lag under your normal load, and decide whether analysts need a freshness indicator or a pipeline timestamp on those dashboards.

Decide where the write target lives before you create the user. A writable target in the same cluster as production raises the blast radius of a bad transform, while a separate analytics database isolates it but adds another system to back up, monitor and grant access to. Choose a dedicated schema or database for Metabase writes, give the writable user privileges only on that location, and record which team owns it. Review these grants whenever you add a new transform or upload target, because the write user is the one credential in this design that is meant to change data.

Security controls to apply to Metabase database roles

The controls below turn the Metabase database user design into something a security review can verify. Each one limits what a Metabase credential can reach, where it is stored, and how it is checked over time. Apply them together, because a read-only user with a shared write password or an open network path still leaves gaps.

Least privilege per schema and table

Grant the Metabase read user CONNECT and SELECT only on the schemas and tables that dashboards and questions actually use, rather than on the whole database. Review the list against the tables Metabase has synced, because sync can expose columns that nobody intended to publish. Check that the user has no CREATE, UPDATE, DELETE or ownership rights anywhere, including on objects created later by other roles.

Metabase user privileges docs

Keeping write credentials out of query paths

Write-capable credentials should never be the connection that analysts query through. Keep the main connection read-only so a crafted native query or an accidental transform cannot change data. Confirm in the Metabase admin settings that the connection used for questions is the read-only one, and that write features point at a separate connection.

Separate credentials per feature

Use one database role for each write feature, such as transforms, CSV uploads, actions and model persistence, instead of a single shared writer. A separate role lets you scope each feature to the schema it needs and revoke one without breaking the others. Name the roles after the feature so an audit log entry is readable without guessing.

Storing and rotating database passwords

Keep each database password in a secrets store or an environment-level secret rather than in a shared document or a configuration file under version control. Set a rotation schedule for each role and confirm that your team can update the Metabase connection without downtime. Record who holds each credential and remove access when someone changes roles.

Auditing grants and periodic review

Query the database catalog for the privileges each Metabase role holds and compare them with the approved design at a fixed interval. Look for drift such as new tables granted by default privileges, roles that inherited membership they should not have, or write rights added during troubleshooting. Keep the output as evidence for access reviews and remove any grant that is no longer needed.

Restricting network access to the database

Allow the Metabase host to reach the database on its port and deny other sources at the firewall, security group or database host rules. Place a write-capable connection behind a narrower rule than the read-only one where your architecture allows it. Confirm the path with a connection test from the Metabase host and a failed test from any other subnet.

Questions teams ask before setting up Metabase database privileges

Is a read-only database user enough for most Metabase teams?

For most teams that only build dashboards and saved questions, a dedicated read-only user is the right starting point. Metabase recommends a read-only user with minimum privileges, meaning CONNECT plus SELECT on only the schemas and tables that dashboards use. Write access is only needed for features such as transforms, CSV uploads, actions and model persistence. Those features can be given their own roles or a writable connection, so the main connection never has to carry write rights. Confirm which of those features your team actually plans to use before granting anything beyond read access. See the Metabase database users documentation for the full list of recommended privileges.

What does the work need from our DBA or platform team?

Creating roles, granting SELECT, and setting up any write roles requires someone with database administration rights on the target system. Your DBA or platform team typically needs to:

  • Confirm which schemas and tables Metabase should expose
  • Create the read-only role and any separate write roles
  • Decide whether the main connection points at a primary database or a read replica
  • Review and store the credentials according to your secrets policy
  • Schedule changes so that new tables are granted when they are added

Agree these responsibilities before setup begins so that access requests do not stall the project.

How long does database privilege setup take?

The duration depends on how many schemas and tables must be granted, how many database engines are involved, and which features need write access. Each separate schema, each write role, and each additional database driver adds review and testing work. A single read-only user on one schema is a small task, while several databases with transforms, uploads and actions need more planning and verification. No fixed duration is supplied for this work, so ask any provider for a timeline based on your written scope, and check how that timeline counts review and testing for each role.

Can our team set up Metabase database privileges without outside help?

Yes, if your team has database administration skills and access to the target database. The core steps are creating a dedicated user, granting CONNECT and SELECT on the required schemas and tables, and connecting Metabase with that user. The harder parts are verifying that the grants match the minimum needed, separating write roles correctly, and testing that users see only what they should. Teams without recent database security experience often prefer an outside review of the grants before production use.

What would a partner need from us to set up these privileges?

A partner would typically need a list of the databases and schemas in scope, the Metabase version and deployment model, the write features your team plans to use, and access to a non-production environment for testing. They would also need the people who approve database changes and the process for storing credentials. Scope, deliverables and timelines are agreed in writing before work starts, so providing this information early makes the quote more accurate.

Do writable connections require a paid add-on?

Yes. A writable connection requires the Advanced transforms add-on. It lets the main connection stay read-only, for example on a read replica, while writes such as transforms or CSV uploads go through a separate user or database. Check current add-on pricing with Metabase before you plan the budget, because the pricing page lists the four plans but the Advanced transforms add-on cost is not part of the supplied facts. The Metabase writable connection documentation describes how the feature is configured.

What breaks most often when database privileges are set up incorrectly?

The most common failures are missing SELECT grants on newly created tables, a main connection that accidentally holds write rights, and write features failing because their role was never granted. Teams also see errors when the read-only user lacks CONNECT on the database itself. Check each feature after setup by running a saved question, a sync and any upload or transform you plan to use. Keep a record of the exact grants so that reviewers can compare them against the minimum privileges.

How Metabase connections map to database roles

The diagram starts with users querying dashboards in the Metabase application, which sends all reads through a dedicated read-only role on the main connection. Writes travel a separate path: transforms, CSV uploads, actions and model persistence each go to their own role or to a writable database connection. The trust boundary sits between the Metabase application and the databases, so the check to make is that no write path can reach the main connection.

Read queries use a read-only role, while writes use separate roles or a writable connection.

Verifying privileges before and after each Metabase upgrade

Treat every Metabase upgrade as a reason to retest database privileges, not only the application. A new release can add features that touch the database in a different way than the version you tested, so a grant set that worked for the read-only Metabase user, or for a writable connection used by transforms, uploads, actions or model persistence, may no longer match what the software asks for. Before you upgrade, record the current grants for each connection in a file you can diff later, and confirm which feature each separate role or writable connection supports in your target release by checking the release notes and the Metabase database users documentation.

Upgrades run application database migrations automatically, so the application database changes before you can inspect the new behavior. Take and verify a backup of the application database first, because that backup is the recovery point if an upgrade or migration goes wrong. This section does not add steps to the upgrade itself. It adds a privilege check that runs alongside it: after the new version starts, sign in as a user in each relevant group, run a saved question on the read-only connection, and confirm that a query against a table outside that group's scope is still blocked. Then exercise each write path you use, such as a CSV upload or a transform, and confirm it succeeds on its own writable connection only.

Use a short, repeatable test list rather than a one-time review. Keep it in version control with the grant scripts, name the user and connection each check uses, and note the Metabase version it was run against. Rerun the same list on a non-production instance before every production upgrade and after any change that enables a new feature, since that change can need a new grant. If a check fails, do not widen the main connection's privileges as a quick fix. Confirm with the Metabase documentation which role the feature needs and grant only that privilege to the writable user or connection that performs the write.

How DeployOpen scopes and delivers Metabase database privilege work

DeployOpen plans, builds, documents and supports self-hosted Metabase inside your own infrastructure, including the database users and roles that sit behind it. The work starts from a written scope that defines which databases, schemas and write paths Metabase needs, so the privilege model is agreed before any grants are created.

How we scope

  • Inventory every database, schema and table the Metabase connection must read, and record who owns each one.
  • Separate the read-only reporting user from any write path for transforms, uploads, actions or model persistence.
  • Agree in writing whether a writable connection or a separate database is needed, and which add-on that depends on.

How we build

  • Create the read-only user with CONNECT and SELECT limited to the agreed schemas and tables, with no write grants.
  • Create separate roles for each write feature, scoped to the exact objects that feature touches and nothing more.
  • Test each connection from inside Metabase and confirm that writes are blocked on the main connection and allowed only where planned.

How we hand over

  • Deliver a grant matrix listing each user or role, its privileges, the objects covered and the Metabase feature that uses it.
  • Document the SQL used to create and revoke each grant so your database team can review and rerun it.
  • Walk through the model with your security and database administrators and record the sign-off in the engagement file.

How we support

  • Review privileges again when new schemas, tables or Metabase features are added, through a change under the same written scope.
  • Check grants during Metabase upgrades, since new features can need additional privileges that should be reviewed first.
  • Ongoing support, upgrades and continuous testing are available as a retainer, scoped in writing with the rest of the work.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.