Edit on GitHub
Jump to docs navigation

Installation

Note: You are currently reading the documentation for Bolt 4.0. Looking for the documentation for Bolt 3.7 instead?

With the release of Bolt 4 stable, there will be a number of ways to install the application. For now, we recommend the composer create-project as the fastest way to get an installation of Bolt up and running. If you don't have composer yet, see here.

Note: This documentation makes the assumption that you're setting up Bolt on a local development machine. Not on the server where you intend to run a production website. If you do not have a local development environment, we recommend taking the time to set this up.

Set up a new Bolt 4 project, using the following command, replacing myprojectname with your desired project's name.

composer create-project bolt/project myprojectname

Navigate into the newly created folder, and configure the database in .env or your environment variables:

# SQLite (note: THREE slashes, if the path is absolute!)
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/bolt.sqlite

# MySQL
DATABASE_URL=mysql://root:"root%1"@127.0.0.1:3306/four

# PostgreSQL
DATABASE_URL=pgsql://root:"root%1"@127.0.0.1:5432/four

You can read more information about configuring the database here.

After configuring the Database, run bin/console bolt:setup. This will create and initialise the Database for you, then lets you create the first user, and add some dummy content ("fixtures") to the database.

Alternatively, run the following commands in sequence to do it step by step:

# In one go
bin/console bolt:setup

# As separate steps
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console bolt:add-user
bin/console doctrine:fixtures:load

Starting a webserver

You can run Bolt locally using the built-in webserver, Symfony CLI, Docker or your own preferred webserver. If you choose to set up a web server yourself, you can either set up something like Mamp, Xampp, Laragaon or otherwise there's docs for Apache and Nginx.

Note: The folder you've just created has a public/ folder. This is the actual web root of the site. If you're not using one of the options below, but are configuring a webserver yourself, make sure you use public/ as the web root. Bolt does not support putting all of its files inside the webroot itself, as that is considered to be a bad practice.

Start PHP's built-in webserver…

bin/console server:start

or use the Symfony CLI …

symfony server:start -d
symfony open:local

or use Docker…

make docker-install

Finally, open the new installation in a browser. If you've used one of the commands above, you'll find the frontpage at http://127.0.0.1:8000/

The Bolt admin panel can be found at http://127.0.0.1:8000/bolt

Log in using the credentials you created when setting up the first user.



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.