Cookies ahead

Our support chat tool "Intercom" would like to collect some more data on you. See the related link for more details.

Docs

Install Craft CMS locally

Reviewedbyfl

Markdown ↓

Set up Craft CMS on your local machine, using Composer or a download, before deploying to fortrabbit.

Install and deploy run down

  1. Install Craft CMS locally ← you are here
  2. Setup an app at fortrabbit
  3. Deploy code via Git
  4. Database syncing
  5. Assets syncing

Get ready

Before installing Craft CMS locally, you need a working development environment and the official installation guide as reference.

Install with Composer

Craft CMS 5 is installed with Composer. Run this command on your local machine to create a new project — the interactive setup wizard then starts automatically:

composer create-project craftcms/craft my-project
shell

Using DDEV? Prefix it: ddev composer create-project craftcms/craft my-project. See an error? Check your local development setup.

The deployment strategy is a separate choice made further down: Git for Composer-managed projects, or SFTP/rsync.

Run the setup wizard

composer create-project launches the setup wizard automatically, asking for database and account details. The defaults mostly work and everything can be changed later.

To re-run it manually — for example after cloning an existing project — use the Craft console command from the project folder:

cd my-project
php craft setup
shell

Add your magic

A fresh Craft CMS installation is bare-bones; now customize it by adding templates, database structure, design, plugins, and content in your local development environment.


Choose a code deployment workflow

Craft CMS projects consist of three parts requiring different deployment strategies: code (application files), database (content tables), and assets (media volumes). Decide now which deployment method suits your workflow.

  • Code - Craft CMS (vendor) + templates/config ← decide now
  • Database - Content tables
  • Assets - Volumes

To connect your app environment to a GitHub repo set up one now. Init git and add GitHub as remote repo - either as a public or private. Here is an example using the GitHub CLI.

# Initialize a new git repository
git init

# Add files and commit
git add .
git commit -m "Init"

# Create a new public repository on GitHub from the current directory
gh repo create --public --source=. --push
bash

We recommend to exclude asset volumes from Git to sync them up and down. In most cases this is already the case.

Skip this step if your code is already at GitHub, see Git provider integration for other providers with CI/pipeline/actions flows. If this is fuzzy to you, see:

B - SFTP / rsync deployment

Later on you can upload Craft with SFTP.

Written by a human. Review, grammar checks and typo fixes by AI.

AI use & editorial processEdit on GitHub ↗