By default, Bytebase bundles an embedded PostgreSQL instance for storing its own metadata. The metadata is stored under the —data directory.
For production setup, you should pass PG_URL
environment variable to store these metadata in an external PostgreSQL database.
PostgreSQL 14 or above.
Supported format:
postgresql://<<user>>:<<secret>>@<<host>>:<<port>>/<<database>>
Example:
postgresql://bytebase:z*3kd2@example.com:5432/meta
The connecting database
must be created in advance. The database should use UTF-8 for encoding. UTF-8 encoding is mandatory across the entire system.
For Cloud Database such as AWS RDS, GCP Cloud SQL, ensure that the user
either owns the schema (public
) and database
, or has the necessary privileges to access them.
ALTER DATABASE database OWNER TO bytebase;
ALTER SCHEMA public OWNER TO bytebase;
The connecting user
must have all the following database privileges:
If you run Bytebase inside Docker and want to connect the pg instance on the same host, then you need to use host.docker.internal
.
This bash script demonstrates how to add an external PostgreSQL database as the metadata store when running the bytebase container.
Use host.docker.internal as the host if you connect the pg instance on the same host.
Make sure that the connecting user is either superuser or is the owner of the connecting database. See User and GitHub Issue.
By default, Bytebase bundles an embedded PostgreSQL instance for storing its own metadata. The metadata is stored under the —data directory.
For production setup, you should pass PG_URL
environment variable to store these metadata in an external PostgreSQL database.
PostgreSQL 14 or above.
Supported format:
postgresql://<<user>>:<<secret>>@<<host>>:<<port>>/<<database>>
Example:
postgresql://bytebase:z*3kd2@example.com:5432/meta
The connecting database
must be created in advance. The database should use UTF-8 for encoding. UTF-8 encoding is mandatory across the entire system.
For Cloud Database such as AWS RDS, GCP Cloud SQL, ensure that the user
either owns the schema (public
) and database
, or has the necessary privileges to access them.
ALTER DATABASE database OWNER TO bytebase;
ALTER SCHEMA public OWNER TO bytebase;
The connecting user
must have all the following database privileges:
If you run Bytebase inside Docker and want to connect the pg instance on the same host, then you need to use host.docker.internal
.
This bash script demonstrates how to add an external PostgreSQL database as the metadata store when running the bytebase container.
Use host.docker.internal as the host if you connect the pg instance on the same host.
Make sure that the connecting user is either superuser or is the owner of the connecting database. See User and GitHub Issue.