Skip to content

Setup a dev environment for freeCodeCamp

This guide sets up a development environment for freeCodeCamp. Work through it once, in order.

Fork the freeCodeCamp repository on GitHub

Section titled “Fork the freeCodeCamp repository on GitHub”

A fork is your own copy of the codebase. You need one to contribute.

  1. Open the fork page:

    Fork freeCodeCamp

  2. Check the details, then click Create fork.

  3. GitHub redirects you to your fork at https://github.com/YOUR_USER_NAME/freeCodeCamp.

In this guide, origin means your fork and upstream means the main repository. You can delete your fork at any time and start again.

There are three ways to run the project. All three work. Compare them, pick one, then follow that tab below.

Local MachineDev ContainerGitHub Codespaces
Where it runsDirectly on your machineIn Docker, on your machineOn a GitHub server
You installNode.js, pnpm, Docker Compose, GitDocker Desktop, VS Code, Dev Containers extension, GitNothing
You manage tool versionsYesNo. The image carries themNo. The image carries them
Machine needed4 CPUs, 8 GB of RAM, 10 GB of disk4 CPUs and 16 GB of RAM given to Docker, plus your own operating system on topA 4-core, 16 GB, 32 GB disk machine. The project sets this minimum
SpeedFastestSlower file access on macOS and WindowsDepends on your connection
Works offlineYes, after setupYes, after the first startNo
CostFreeFreeA free monthly quota, then paid

Each option gives you the same running application, so pick the one that fits your machine.

Skip this section if you picked GitHub Codespaces — it clones your fork for you. You need Git installed first.

  1. Clone your fork, replacing YOUR_USER_NAME with your GitHub username:

    Terminal window
    git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
    cd freeCodeCamp
  2. Add a remote that points at the main repository, so you can sync later:

    Terminal window
    git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git

    Run git remote -v to confirm. You should see origin on your fork and upstream on freeCodeCamp/freeCodeCamp.

  3. (Optional) To work on a localized curriculum, fetch the i18n-curriculum submodule:

    Terminal window
    git submodule update --init

Your machine needs 4 CPU cores, 8 GB of RAM and 10 GB of free disk space, on macOS or Linux.

PrerequisiteVersionNotes
GitlatestThe version bundled with your operating system is often outdated.
Node.js24.xThe “Active LTS” version. See the LTS schedule.
pnpm10.x-
Docker Compose2.xStarts MongoDB for you below.
MongoDB Community Server8.xOptional. Only if you prefer to run MongoDB without Docker.

Check what you have:

Terminal window
node -v && pnpm -v

Recommended, but not required:

  1. Create your environment file:

    Terminal window
    cp sample.env .env

    The defaults run the app as it is. Change them only if you want your own Auth0, Algolia or Stripe keys.

  2. Install dependencies:

    Terminal window
    pnpm install

    WSL users: run pnpm run playwright:install-build-tools first. It installs system packages that Playwright and Puppeteer need.

  3. Stop any MongoDB server already using port 27017, then start MongoDB as a replica set:

    Terminal window
    docker compose -f docker/docker-compose.yml -f docker/docker-compose.ports.yml up -d

    This also starts Mailpit, which catches outgoing email at http://localhost:8025.

  4. Seed the database:

    Terminal window
    pnpm run seed

    This creates a test user with no completed certifications. For a user with certifications, run pnpm run seed:certified-user instead, then clear your browser cookies and sign in again.

  5. Start the client and the API:

    Terminal window
    pnpm run develop

    A full curriculum build takes several minutes. Open http://localhost:8000 when it finishes.

  • The API serves endpoints at http://localhost:3000, with docs at /documentation. In Codespaces, open these from the Ports panel.
  • Mailpit catches outgoing email at http://localhost:8025 (or the Ports panel in Codespaces).

Working on curriculum content? Build only the part you need. It is far faster:

Terminal window
FCC_SUPERBLOCK='responsive-web-design-v9' pnpm run develop

See Quick Commands Reference for FCC_BLOCK and FCC_CHALLENGE_ID.

Handy Scripts to use locally

CommandDescription
pnpm installInstalls / re-installs all dependencies.
pnpm run seedCreates authorized test users and inserts them into MongoDB. Also runs seed:exams and seed:surveys below.
pnpm run seed:certified-userCreates authorized test users with certifications fully completed, and inserts them into MongoDB.
pnpm run seed:examsCreates exams and inserts them into MongoDB.
pnpm run seed:surveysCreates surveys for default users and inserts them into MongoDB.
FCC_SUPERBLOCK='responsive-web-design-v9' pnpm run developStarts the API Server and Client, building only the specified SuperBlock (recommended for curriculum work).
FCC_BLOCK='workshop-curriculum-outline' pnpm run developStarts the API Server and Client, building only the specified Block (recommended for curriculum work).
FCC_CHALLENGE_ID=646cf6cbca98e258da65c979 pnpm run developStarts the API Server and Client, building only the specified Challenge (recommended for curriculum work).
pnpm run developStarts the freeCodeCamp API Server and Client Applications with full curriculum build (for thorough testing).
pnpm run cleanUninstalls all dependencies and cleans up caches.