Skip to main content
This article explains how to run your own OpenFGA server using Docker. To learn the different ways to configure OpenFGA check Configuring OpenFGA.

Step by step

If you want to run OpenFGA locally as a Docker container, follow these steps:
  1. Install Docker (if not already installed).
  2. Run docker pull openfga/openfga to get the latest docker image.
  3. Run docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 openfga/openfga run.
This will start an HTTP server and gRPC server with the default configuration options. Port 8080 is used to serve the HTTP API, 8081 is used to serve the gRPC API, and 3000 is used for the Playground.

Using Postgres

To run OpenFGA and Postgres in containers, you can create a new network to make communication between containers simpler:
You can then start Postgres in the network you created above:
You should now have Postgres running in a container in the openfga network. However, it will not have the tables required for running OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like:
Finally, start OpenFGA:
This will start the Postgres database, run openfga migrate to configure the database and finally start the OpenFGA server.

Using MySQL

We first make a network:
Then, start MySQL in the network you created above:
You should now have MySQL running in a container in the openfga network. But we still have to migrate all the tables to be able to run OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like:
Finally, start OpenFGA:
This will start the MySQL database, run openfga migrate to configure the database and finally start the OpenFGA server.

Using SQLite

We first make a network:
Then, create a volume to hold the openfga database:
Next you have to migrate all the tables to be able to run OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like:
Finally, start OpenFGA:
This will create a new openfga volume to store the SQLite database, run openfga migrate to configure the database and finally start the OpenFGA server.

Pre-shared key authentication

To configure with pre-shared authentication and enabling TLS in http server with Docker.
  1. Copy the certificate and key files to your Docker container.
  2. Run with the following command:

OIDC authentication

To configure with OIDC authentication and enabling TLS in http server with Docker.
  1. Copy the certificate and key files to your docker container.
  2. Run the following command

Enabling profiling

If you are enabling profiling, make sure you enable the corresponding port in docker. The default port is 3001, but if you need to serve the profiler on a different port, you can do so by specifying the --profiler-addr flag. For example:
Check the following sections for more on how to use OpenFGA.

Running OpenFGA in Production

Learn the best practices of running OpenFGA in a production environment
Last modified on September 28, 2026