How To Install
How To Install
You do not have to install a local version of the website in order to make contributions; however, installation of the website in a local environment is recommended when you are considering contributions that exceed the level of “fixing a typo.” See our How To Contribute document for guidance.
Getting ready
This installation guide assumes that you are familiar with the command line and have Git installed. To check if you have Git, open a command line and type:
git --version
If you do not get a version number, follow the instructions on how to install Git.
Installation methods
There are two ways you can install the site on your local computer:
- Using Docker
- Custom install
Using Docker
Docker is a platform that allows you to run virtual environments; in this case, on your local machine. The environments come in the form of containers that you can access and manage through the command line or through the Docker Desktop app. The cloud.nih.gov repo includes a file docker-compose.yml that has instructions for building an environment that is optimized to run the site.
Download and install Docker Desktop from the following link: https://www.docker.com/
- Clone the repo and navigate into the directory in your terminal.
$ git clone <https://github.com/NIHGOV/CloudDocumentation.git>
$ cd /path/to/cloned/directory
- Create the Docker container from the image by running:
$ docker-compose up
Tip: You can watch the build progress in the Docker desktop app.
The site is served locally at http://localhost:4000 or http://0.0.0.0:4000/ and should automatically reload when you make changes to relevant files.
Custom install
You can also manually install all the components that you need to run the site in your local environment.
- Ensure that you have Ruby and Node installed by following the instructions at the following pages:
Once installed, run the following commands on your command line to ensure everything worked correctly. If they return the version number, proceed to the next step.
$ npm --version
$ ruby --version
- Clone the repo then navigate into that directory in your terminal.
$ git clone <https://github.com/NIHGOV/CloudDocumentation.git>
$ cd /path/to/cloned/directory
- Install the needed node packages/build tools:
$ npm install
$ bundle install
$ npm install -g gulp
$ npm install -g gulp-cli
- Build the Jekyll site by running
$ npm run build
If everything worked correctly, Jekyll should build your site into the _site directory.
To develop this site and/or test it locally:
$ npm start
The site should be served at https://localhost:4000 and automatically reload when you make changes in relevant files.