Set up database

Simple Invoices works with MySQL, MariaDB, PostgreSQL, or SQLite. Create a database, point the app at it, then finish setup below.

Before you begin

1
Create an empty database

On MySQL or MariaDB, create a database with a UTF-8 collation. On PostgreSQL, create a role and database. For SQLite, ensure the data directory is writable; the file name comes from the database name.

2
Point the app at the database

Set database.adapter and database.params in config/config.php, or set Docker environment variables (see below).

3
Install schema and sign in

Check the connection summary, set your first administrator, then import the schema and essential data.

Using Docker

Set SI_DATABASE_ADAPTER to pdo_mysql, pdo_pgsql, or pdo_sqlite, together with SI_DB_HOST, SI_DB_PORT, SI_DB_USER, SI_DB_PASSWORD, SI_DB_NAME, and SI_DATABASE_UTF8 in your .env file or in the simpleinvoices service in docker-compose.yml. For PostgreSQL run: docker compose -f docker-compose.yml -f docker-compose.pgsql.yml up. For SQLite run: docker compose -f docker-compose.yml -f docker-compose.sqlite.yml up (the database file is stored in the sqlite_data volume).

Not using Docker

Edit config/config.php in the [production] section. Set database.adapter to pdo_mysql, pdo_pgsql, or pdo_sqlite, and set database.params.host, port, username, password, and dbname to match your server. For SQLite, dbname is the filename (no path) under databases/sqlite/.

Connection in use

Adapter pdo_sqlite
Host
Port
Database facdev
Username
Password ••••••••••

The currency and locale defaults on your new installation will match this choice.

First administrator

The first administrator defaults to email demo@simpleinvoices.org and password "demo". Change the fields if you want different credentials before you install.

Need help? Visit http://www.simpleinvoices.org for documentation and support.