How to Install Statamic Locally

Fast-track local install for getting Statamic running on your computer or development machine.

Overview

Running Statamic locally is the preferred method for building and maintaining your sites. With version control (we recommend git), it's quite simple to deploy changes almost instantly from your local computer to a live site with a single command.

Feel free to watch instead of read!

Heads up!

This video assumes you're serving your local sites using Laravel Valet.

Prerequisites

To install Statamic locally you will need the following:

  • A computer running MacOS, Windows, or Linux
  • A supported version of PHP (we recommend PHP 8)
  • Composer to manage PHP packages

Install Statamic CLI

Statamic CLI is a commandline tool to help you get Statamic installed quickly and easily. The package can be installed on your machine using Composer:

composer global require statamic/cli

Once installed, you can run the command statamic list to see a list of available commands.

Hot Tip!

If you run into any issues or errors, check out this helpful article on what to do next.

Install Statamic

In your terminal, cd to the parent directory you want to start a new Statamic project in and run the install command.

statamic new $project_name

You'll be asked if you want to install a blank site or a Starter Kit. If this is your first time, we usually recommend starting with a blank site. Keep it simple.

Next, you'll be prompted to set up your first super admin user. Do it.

After that, everything is finished!

Accessing the site

The address where you access the site will be different depending on your development environment.

For example, if you're using Valet then your site would be at http://$project_name.test and the Control Panel at /cp.

If you don't have Valet or some other server set up, you can run php artisan serve to use the built-in server, then use the URL it provides, (which is typically http://127.0.0.1:8000).

$ php artisan serve
Starting Laravel development server: http://127.0.0.1:8000

Troubleshooting

If your local environment is reasonably "up to date", everything should have gone smoothly. But let's face it, tech doesn't always work the way it's supposed to on the first try.

Check out the troubleshooting section to get help about common error messages.

What's Next

You're now (probably) running the latest and greatest version of Statamic! Well done! 🎉 You can now get on with the fun parts.

The Quick Start Guide is a great place to head next if you're just kicking the tires (or tyres — if you're not from our neck of the woods).

Hot Tip!

You can use Pro features while in development (like users, permissions revisions, REST API, and so on), by setting 'pro' => true in config/statamic/editions.php.

Another Hot Tip

The default install and all first-party Starter Kits use TailwindCSS in Just In Time mode, so anytime you change classes in your HTML you'll need to recompile your CSS.

This is super easy and happens automatically when you run npm run dev from the terminal in your project directory (as long as you've run npm install first).

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →