Learn coding on FreeCodeCamp without internet access
Tags: beginners, python, javascript, tutorial
Published: 2021-05-17 04:44:26

Not all of us have the privilege of having access to the internet at all times of the day. Imagine someone who travels to another city to attend a coding bootcamp, where they learn code with the help of [freecodecamp.org](https://www.freecodecamp.org/), but when they go home, they can’t continue to learn on their own because they don’t have access to the internet at their home. Imagine also another person who struggles to learn to code on their own during the 4 hours every day when the internet happens to be working. This is the reality for many who aspire to learn how to code.

In this guide, I will show you how to run [freecodecamp.org](https://www.freecodecamp.org) offline, so you can complete coding certifications completely without internet access.

## Before you get started

You will need:

* A computer
* Temporary internet access for downloading FreeCodeCamp and its dependencies

FreeCodeCamp takes approximately 45 minutes to set up and install.

I will be providing instructions for both Windows 10. At the beginning of each step, I link to the installation instructions on other systems. If you have any questions, let me know in the comments below this article.

## Step 1: Installing MongoDB on Windows

Below are the instructions for installing MongoDB on Windows 10. For other systems, [click here for all the tutorials on installing MongoDB on each platform](https://docs.mongodb.com/manual/installation/). Otherwise, continue below.

**1.** Go to <https://www.mongodb.com/try/download/community> and select the platform "Windows" and the package-type "msi". The version I installed was 4.0.24. Your screen should look something like this:

![MongoDB step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xxanz6bvj8isggwi3jfc.png)

**2.** After clicking "Download", locate the newly downloaded `.msi` file and double click it.

**3.** When you get to this page, ensure all the features are selected, and that "Server" is configured to install on the local hard drive.

![MongoDB step 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hy6bhh7bo07i18mpouxe.png)

**4.** After clicking `Next >`, you'll be brought to this page. Make sure "Install MongoDB as a service" is unselected. You don't need MongoDB running as a service all the time since it uses memory. Instead, we will only start it before running FreeCodeCamp.

![MongoDB step 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/imgwa5259xrs75yp05tw.png)

**5.** Now click through until the end of the installation instructions, and wait for MongoDB to install.

## Step 2: Installing NPM and Node.js on Windows

Below are instructions for installing NPM and Node.js on Windows. For other systems, [click here for instructions on installing with a package manager](https://nodejs.org/en/download/package-manager/).

To install NPM on windows, go to [nodejs.org](https://nodejs.org/) and click the download button to get the `.msi`. Double-click the downloaded `.msi` and step through the prompts on the Node.js setup wizard.

Once you get to this page, make sure "install the necessary tools" is checked:

![Node.js Install Instructions for Windows 10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wod6xtq1lr3h2m4i8m9z.png)

This will make sure any dependancies you need are met, and also will provide you with some packages like Chocolately, C, C++, Python, enabling you to make your own projects based on things you learn in FreeCodeCamp.

> Chocolately is a package manager for windows, which is an easy way to install new packages through `choco install package_name`

## Step 3: Cloning FreeCodeCamp

In this step, for Windows use "Windows Powershell", and for Linux use the terminal.

**1.** Navigate to the directory you want to install freeCodeCamp using `ls` and `cd` commands.

**2.** If you don't have Git installed, install it using your computer's package manager.

**3.** For windows users, since we installed "Chocolately" in the previous step, we can use that to install Git, like so:

```bash
choco install git
```

**4.** Now use Git to clone FreeCodeCamp. `depth=1` is used to only download necessary commits which will speed up the download process.

```bash
git clone --depth=1 https://github.com/freeCodeCamp/freeCodeCamp
```

## Step 4: Installing FreeCodeCamp

First, navigate into the newly created directory with `cd freeCodeCamp`, and then run this command to start the installation process:

```bash
npm ci
```

This part takes a while. While you wait for the dependencies to install, continue to [Step 5](#Step-5-Starting-the-database).

## Step 5: Starting the database

Open up a new powershell or terminal, and start the MongoDB database service like so:

**For Linux**

```bash
mongod --dbpath=/path/to/freeCodeCamp
```

**For Windows**

```bash
"C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe" --dbpath=/path/to/freeCodeCamp
```

This service will need to be started each time before you can run FreeCodeCamp in the future, so take note of this command.

## Step 6: Seed the database

After Step 4 completes, run this command from the powershell or terminal used in Step 4 to set up the data in the MongoDB database:

```bash
npm run seed
```

You only have to run this command once. The next time you start FreeCodeCamp, the database should already be initialized.

## Step 7: Start FreeCodeCamp

In the same powershell or terminal from Step 6, run this command to start FreeCodeCamp:

```bash
npm run develop
```

The first time you run this command, it will take a while to complete due to building and installing FreeCodeCamp. Once you see this line, this means the command finished and FreeCodeCamp is ready for you to use:

```
success Building development bundle - 303.218s
```

As you see from the output above, it took 5 minutes to run this command for me.

## Step 8: Open FreeCodeCamp in the browser

**1.** Open up your web browser and navigate to <http://localhost:8000>.

**2.** Click "Get started now, it's free!"

**3.** Now you will see "Welcome back, Development User."

**4.** You are now signed in as a development user, and can now access all the courses without the internet. Any progress you make will be saved in the MongoDB instance you started in [Step 5](#Step-5-Starting-the-database).

Next time you want to start FreeCodeCamp, you can do so without internet by following both [Step 5](#Step-5-Starting-the-database) and [Step 8](#Step-8-Open-FreeCodeCamp-in-the-browser) in two different powershells or terminals.

Have fun learning!

> Reposted from <https://www.codingwithricky.com/2021/05/15/freecodecamp-offline/>.
> 
> This guide is based off of FreeCodeCamp's instructions for setting up a development environment for contributing to FreeCodeCamp's source code. If you want to contribute to development, more details can be found [at this link](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/docs/how-to-setup-freecodecamp-locally.md).