Install Craft CMS local

# 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

# Choose your install workflow

The way you will install Craft will set the course on how you will deploy Craft CMS here on fortrabbit:

This is the recommended - more sophisticated - way. You will use Git and Composer in the Terminal. Run this command on you local machine to create a Craft CMS project to get started:

composer create-project craftcms/craft my-project
shell

See an error? Check your local development. Later on you can deploy Craft with Git on fortrabbit.

# B - Download zip file

Are you more "designer" and less "developer"? Just download Craft directly from the Craft website: craftcms.com/latest-v3.zip. Unpack that zip file to get to the actual project files.

# Install Craft CMS locally

Configure it to work on your local machine now. You have two options to install Craft:

# 1. go into your local Craft folder
$ cd my-project

# 2. run the terminal installer
$ ./craft setup
content/index.md
shell

This will ask you some questions, the defaults will work mostly, you can change these settings later.

# B - Browser setup

You can also run the installer in the browser by visiting this address: http://{{host}}/index.php?p=admin/install in your browser. Substitute {{host}} with the host name of your local development environment.

# Add your magic

Installing a plain Craft CMS will not do much. Now add your templates, database structure, design, plugins and content to make it shine. We recommend to do this work mostly in your local development environment.


# Choose a code deployment workflow

Now is a good time to think ahead a bit. How do you plan to keep your local project and the remote app environment at fortrabbit in sync? Understand that Craft CMS basically consists of three parts that needs special treatment for deployment:

  • 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 fuzzy to you see:

# B - SFTP / rsync deployment

Later on you can upload Craft with SFTP.

Found a tpyo?Edit