Skip to content

Local Environment Setup

How to get a project running on your local machine from scratch.

Prerequisites

Install the following tools before starting:

  • Git
  • Docker + Docker Compose
  • Node.js LTS (used for dotenv tooling)
  • Composer (optional — only needed to run PHP commands locally)

1. Clone the repository

git clone git@bitbucket.org:<team>/<project>.git

Initialize submodules (required for shared cronjobs and other submodule dependencies):

git submodule update --init --recursive

2. Start Docker

From the project root (not ./site or ./devops), build and start the containers:

docker compose build --no-cache && docker compose up -d

Ensure the following containers are running: PHP, Nginx, MariaDB, and Redis (if applicable).

If the project uses a named Docker network, connect all containers to it:

docker network connect <network_name> <container_name>

List available networks:

docker network ls

3. Environment variables

To use .env.cloud with local encryption, navigate to the site directory and generate encryption keys:

cd ./site
npm run env:keys

Copy the staging key output and paste it into .env.cloud at the project root.

4. Initialize the local environment

Run the local deployment script from the project root:

./devops/deployment-script.sh --env=local

This installs PHP and Node dependencies, compiles assets, and sets up the local release folder.