Skip to content

Setting up your local environment

Learn how to set up your local Braze Docs environment, so you can make complex or multi-page changes.

Prerequisites

If you haven’t already, complete the steps for Contributing to Braze Docs.

Setting up your local environment

Step 1: Get the required software

At a minimum, you need a terminal, a text editor, and a ruby version manager. If you’re not sure where to start, see the following.

Step 2: Create an SSH key

Next, create an SSH key for your GitHub account. Note that if you’re using WSL, be sure to follow the Linux instructions to create your SSH key.

Step 3: Clone your forked repository

In GitHub, open your forked repository, then select Code > SSH > Copy.

An example forked repository with the "Code" dropdown open showing the "Copy" option.

In your terminal, open your home directory, then clone the Braze Docs repository.

1
2
cd ~
git clone [email protected]:braze-inc/braze-docs.git

Step 4: Add a remote for braze-inc/braze-docs

To ensure that your changes are pushed to the official Braze Docs repository, instead of your fork, you’ll need to set up a new remote in Git.

1
2
cd ~/braze-docs
git remote add upstream [email protected]:braze-inc/braze-docs.git

To verify that your new upstream remote was added successfully, list your remotes using the remote command’s -v option.

1
2
3
4
5
$ git remote -v
origin    [email protected]:internetisaiah/braze-docs.git (fetch)
origin    [email protected]:internetisaiah/braze-docs.git (push)
upstream  [email protected]:braze-inc/braze-docs.git (fetch)
upstream  [email protected]:braze-inc/braze-docs.git (push)

Step 5: Install Ruby

To generate a local site preview, you’ll need Ruby version 3.3.0 installed. In the terminal, open braze-docs and check for Ruby version 3.3.0.

1
2
cd ~/braze-docs
ruby --version

If this version isn’t installed, use a supported version manager to install Ruby version 3.3.0. For example, using rbenv:

1
rbenv install 3.3.0

Step 6: Install dependencies

Next, install the dependencies for Braze Docs. These are small programs used to generate your local Braze Docs site.

1
bundle install

Step 7: Start your local server

To verify your installation and start your local docs server on localhost http://127.0.0.1:4000, run:

1
2
3
4
5
6
7
8
9
# for 'en' language:
rake

# for other langauges:
rake es
rake fr
rake ja
rake ko
rake pt_br

To stop your server, reopen the terminal and press Control+C.

Next steps

If you’re new to Git or docs-as-code, start with our tutorial: Your first contribution. Otherwise, check out one of the following.

HOW HELPFUL WAS THIS PAGE?
New Stuff!