Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guid

SQLite is the default ([Quick Start](/developer-docs/latest/getting-started/quick-start.md)) and recommended database to quickly create an app locally.

## Install SQLite locally
## Install SQLite using starter

Simply use one of the following commands.
Use one of the following commands:

<code-group>

Expand All @@ -34,6 +34,40 @@ This will create a new project and launch it in the browser.
The [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md) is a complete step-by-step tutorial.
:::

## Install SQLite manually

In terminal, run the following command:

<code-group>

<code-block title="NPM">
```sh
npm install better-sqlite3
```
</code-block>

<code-block title="YARN">
```sh
yarn add better-sqlite3
```
</code-block>

</code-group>

Add the following to your `./config/database.js` file:

```js
module.exports = ({ env }) => ({
connection: {
client: 'sqlite',
connection: {
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
useNullAsDefault: true,
},
});
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the following code for TypeScript as well (using the code-group/code block like above)?

import path from 'path';

export default ({ env }) => ({
  connection: {
    client: 'sqlite',
    connection: {
      filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
    },
    useNullAsDefault: true,
  },
});

## Other SQL Databases (PostgreSQL, MySQL)

Refer to the [configuration section](/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md) for all supported options to setup Strapi with your SQL database.
Expand Down