- An example database schema can be found <aclass="grey--text"href="https://github.com/lerocha/chinook-database/tree/master/ChinookDatabase/DataSources"><u>here</u></a>.
Before doing so, make sure you have a Heroku account. By default, an add-on Heroku Postgres will be used as meta database. You can see the connection string defined in `DATABASE_URL` by navigating to Heroku App Settings and selecting Config Vars.
Tip 1: To persist data in docker you can mount volume at `/usr/app/data/` since 0.10.6. In older version mount at `/usr/src/app`.
</alert>
<alerttype="success">
Tip 2: If you plan to input some special characters, you may need to change the character set and collation yourself when creating the database. Please check out the examples for <ahref="https://github.com/nocodb/nocodb/issues/1340#issuecomment-1049481043"target="_blank">MySQL Docker</a>.
</alert>
### Docker Compose
We provide different docker-compose.yml files under <ahref="https://github.com/nocodb/nocodb/tree/master/docker-compose"target="_blank">this directory</a>. Here are some examples.
<code-group>
<code-blocklabel="MySQL"active>
```bash
git clone https://github.com/nocodb/nocodb
cd nocodb/docker-compose/mysql
docker-compose up -d
```
</code-block>
<code-blocklabel="Postgres">
```bash
git clone https://github.com/nocodb/nocodb
cd nocodb/docker-compose/pg
docker-compose up -d
```
</code-block>
<code-blocklabel="SQL Server">
```bash
git clone https://github.com/nocodb/nocodb
cd nocodb/docker-compose/mssql
docker-compose up -d
```
</code-block>
</code-group>
<alerttype="success">
Tip 1: To persist data in docker you can mount volume at `/usr/app/data/` since 0.10.6. In older version mount at `/usr/src/app`.
Tip 2: If you plan to input some special characters, you may need to change the character set and collation yourself when creating the database. Please check out the examples for <ahref="https://github.com/nocodb/nocodb/issues/1313#issuecomment-1046625974"target="_blank">MySQL Docker Compose</a>.
</alert>
## Production Setup
By default, sqlite is used for storing meta data. However, you can specify your own database. The connection params for this database can be specified in `NC_DB` environment variable. Moreover, we also provide the below environment variables for configuration.
| NC_TOOL_DIR | No | App directory to keep metadata and app related files | Defaults to current working directory. In docker maps to `/usr/app/data/` for mounting volume. |
| NC_DISABLE_ERR_REPORT | No | Disable error reporting | |
| AWS_ACCESS_KEY_ID | No | For Litestream - S3 access key id | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 |
| AWS_SECRET_ACCESS_KEY | No | For Litestream - S3 secret access key | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 |
| AWS_BUCKET | No | For Litestream - S3 bucket | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 |
| AWS_BUCKET_PATH | No | For Litestream - S3 bucket path (like folder within S3 bucket) | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 |
If your service fails to start, you may check the logs in ECS console or in Cloudwatch. Generally it fails due to the connection between ECS container and NC_DB. Make sure the security groups have the correct inbound and outbound rules.