3. Set up your local dev environment DockerNative CLI

These are the instructions for Docker users. If you are not using Docker, see the Native CLI instructions instead.

Create a local directory for your project.

Create a new empty directory for your project.

mkdir ~/MyFirstAirshipSite
Copied!

Notes:

  • In this guide we are creating a new empty project in the home directory. You can use any subdirectory you want.
  • If you use a source code management tool like Git, you can initialize this directory as a versioned project. Commit all files, including the hidden .airship directory.

Navigate to your local project directory:

cd ~/MyFirstAirshipSite
Copied!

Take note of your site subdomain.

Take note of your subdomain. If you aren't sure what it is, it is listed in bold text on your generated site webpage (and it is also the identifier before ".airshipcms.io" in your browser url bar:

Site Created

Run the Docker container

Select your current platform and run the appropriate docker run command to run a new docker container.

OSX

Navigate to your project directory

cd ~/Projects/my-airship-project

Use this command in your airship project directory when using OSX.

Run Airship Launcher with docker

docker run --rm -it \
  -v $PWD:/srv \
  -v ~/.airship-sessions:/home/.airship-sessions \
  -p 9800-9828:9800-9828 \
  -p 9001:9001 \
  airshipcms/launcher
Copied!

Linux

Navigate to your project directory

cd ~/Projects/my-airship-project

Use this command in your airship project directory when using Linux.

Run Airship Launcher with docker

docker run --rm -it \
  -v $PWD:/srv \
  -v ~/.airship-sessions:/home/.airship-sessions \
  -p 9800-9828:9800-9828 \
  -p 9001:9001 \
  airshipcms/launcher
Copied!

WSL (Windows Subsystem Linux 2)

Docker Desktop Version 3.3.0 or higher is required.
Ensure you are using the latest version of Docker Desktop for Windows.

Navigate to your project directory

cd ~/Projects/my-airship-project

Use this command in your airship project directory when using WSL.

Run Airship Launcher with docker

docker run --rm -it \
  -v $PWD:/srv \
  -v ~/.airship-sessions:/home/.airship-sessions \
  -p 9800-9828:9800-9828 \
  -p 9001:9001 \
  airshipcms/launcher
Copied!

If you run into any unexpected issues, check out the troubleshooting guide at https://airshipcms.io/docker#troubleshooting


Windows - PowerShell

Docker Desktop Version 3.3.0 or higher is required.
Ensure you are using the latest version of Docker Desktop for Windows.

Navigate to your project directory

cd Projects\my-airship-project

Use this command in your airship project directory when using Windows and PowerShell.

Run Airship Launcher with docker

docker run --rm -it `
  -v "$($PWD):/srv" `
  -v "$($PWD)\.airship-sessions:/home/.airship-sessions" `
  -p 9800-9828:9800-9828 `
  -p 9001:9001 `
  airshipcms/launcher
Copied!

If you run into any unexpected issues, check out the troubleshooting guide at https://airshipcms.io/docker#troubleshooting


Windows - Command Shell (cmd)

Docker Desktop Version 3.3.0 or higher is required.
Ensure you are using the latest version of Docker Desktop for Windows.

Navigate to your project directory

cd Projects\my-airship-project

Use this command in your airship project directory when using Windows and CMD.

Run Airship Launcher with docker

docker run --rm -it ^
  -v %cd%:/srv ^
  -v %cd%/.airship-sessions:/home/.airship-sessions ^
  -p 9800-9828:9800-9828 ^
  -p 9001:9001 ^
  airshipcms/launcher
Copied!

If you run into any unexpected issues, check out the troubleshooting guide at https://airshipcms.io/docker#troubleshooting



You should now see the interactive Airship Launcher docker prompt.

Interactive Airship Launcher Docker container session

Note: If you are not using Docker, docker commands will not work. See the Native CLI local development instructions if you are using a native install of Airship CLI.

airship login to access your project content.

Inside your project directory, run the following command. Be sure to replace
[subdomain] with your actual subdomain:

airship login [subdomain]

When you are prompted to set the current directory /srv as the root of your Airship CMS site, enter y to confirm.

airship login mysite

A long url will be displayed. Copy this url from your terminal, and paste it in the address bar of your browser. Make sure to copy the whole url, there are no spaces or line breaks.

Some terminals allow you to CMD + Click or CTRL + Click on the url to open it in your browser.

airship login url

Opening this url in your browser window will display the login form.

Auth0 Popup

Once you log in successfully, you can close the browser window. Your terminal should show Successful Authentication.

Successful Authentication

airship land to retrieve files.

In the interactive Airship Launcher docker container, run the following command to pull the project files that were generated during site creation.

airship land
Copied!

When prompted, enter y to confirm.

airship land output

Running airship land will generate a compartments directory containing very basic Airship files that are necessary for building out your project templates.

airship land results

Open your local files in a text editor.

Open your entire directory in a text editor. You will later be editing the site files.

Note: If you use the terminal to launch your editor, (such as code . or subl .), then you must execute the command in a new terminal session that is not attached to the docker container.

airship serve to run your site locally.

Start a local development server by using the following command.

airship serve
Copied!

airship serve

Leave this terminal open to keep the local server running during development.

If you need to run other airship commands while this server is running, open a new terminal and execute the same docker command from the Run the Docker container step without any of the -p flags. Make sure to run it in the same project directory!

View your local site in a browser.

In a browser, navigate to localhost:9001. You will see actual site content, but it is now rendered with your local layouts, templates, and assets. For now, the webpage looks exactly the same as the live site:

Local Site Created

If you ever encounter problems with the CLI, it is usually because the docker run cammand has been initiated in the incorrect directory. Refer to the CLI Troubleshooting Docs if you run into any issues.


Next: Edit Content in Airship Admin