2 min read

Setting Up SQLite in a Laravel Application

Giorgi Giunashvili

Delivery Manager & Software Architect

SQLite

First of all, what is SQLite?

SQLite is one of the representatives of SQL database systems best known for its simpleness and high speed. Therefore, SQLite is an excellent choice for middle-sized projects. It is small, flexible, fast, and quite simple to set up in our application.

SQLite is not a Client/Server RDBMS (Relational Database Management System); it is built-in in our application, and the data is being retrieved/stored/modified during our application process. 

With Client/Server RDBMS, our application is a separate process, and the database is another. That relation means that the connection between the database is basically a dialogue and intercommunication between computer processes. Communication within the computer processes requires extra resources and usually causes delays. In that respect, SQLite is more efficient. 

However, SQLite has its drawbacks. At any given moment, SQLite can only make one entry. So if the traffic for database entries is high, it slows down. However, fetching data from the database can be divided into different streams. Therefore, it is essential to consider how much and what kind of workload our application will have and choose the database accordingly. 

Make good choices

Prerequisites for the setting up SQLite in Laravel (Ubuntu, WSL)

To use SQLite, we need to install the appropriate package:

sudo apt install sqlite3
 

You also need to install the PHP extension for PHP to communicate with the SQLite database.

sudo apt install php-sqlite3

SQLite configuration in Laravel

One of the drivers of Eloquent is SQLite; therefore, setting up SQLite in Laravel means just changing the .env file. 

The standard database configuration in a .env file looks like this:

env DB configuration

The only thing we need from here is DB_CONNECTION. We can delete the rest because since SQLite is a one-file database, it doesn’t need a database name, user, or password, nor does it have any user privileges. 

Put sqlite in DB_CONNECTION and delete the rest of the parameters from .env:

env DB conection

You will also need to create an empty file in the database folder and name it as database.sqlite because generally, Laravel searches the SQLite file at that address:

SQLite database

If you want to have an SQLite database (file) on the other address, you should tweak the config/database.php and put the desired name and address of the file:

Laravel database configuration

And that’s it, 

Happy Querying ?

It is done

 

Updated on Jul 10, 2026 by

Giorgi Giunashvili

First published on Aug 14, 2025

Giorgi Giunashvili

About the author

Giorgi Giunashvili

Delivery Manager at Redberry

Co-founded Redberry's Laravel Bootcamp

Built E-space, EV Marketplace

Giorgi is a Software Architect and Laravel engineer at Redberry who has delivered production platforms across EV mobility, banking, car rental, and professional-services SaaS. He built E-space, an EV-charger marketplace, the ProCredit Bank website, and Skippit, a multi-tenant ERP for professional-service firms. He also co-founded Redberry's Laravel bootcamp and authors the company's PHP and Laravel developer tutorials.

img

Meet the authors

We are a 200+ people agency and provide product design, software development, and creative growth marketing services to companies ranging from fresh startups to established enterprises. Our work has earned us 100+ international awards, partnerships with Laravel, Vue, Meta, and Google, and the title of Georgia’s agency of the year in 2019 and 2021.

img
CONTACT US
img

Get in touch

Dati Chkhikvishvili

Chief Business Officer