You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/how-to-setup-freecodecamp-locally.mdx
+98-56Lines changed: 98 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,57 +67,43 @@ The main repository at `https://github.com/freeCodeCamp/freeCodeCamp` is often r
67
67
68
68
</Aside>
69
69
70
-
## Cloud IDE or your own machine?
70
+
## Local machine or devcontainer setup?
71
71
72
-
Next, you need to choose between setting up a cloud IDE or your own machine.
72
+
Next, choose between a machine-native setup (recommended) or a containerized setup using devcontainers.
73
73
74
-
If you're looking to make a one-time contribution or want the fastest setup, use GitHub Codespaces which provides a ready-to-code environment in your web browser using devcontainers. For long-term contributions where you prefer local development, you can set up freeCodeCamp on your local machine.
74
+
The **local machine setup** is the recommended approach for regular contributors. You install the prerequisites (Node.js, pnpm, MongoDB) directly on your machine, which gives you the best performance, no usage limits, and no Docker dependency. This requires a macOS or Linux environment (Windows users need [WSL2](/how-to-setup-wsl)).
75
75
76
-
| Feature | GitHub Codespaces | Your own machine |
|**Setup complexity**| Easy setup with devcontainers, works in any browser | Larger download and setup time |
82
-
|**Internet dependency**| Requires an internet connection to work | Minimal internet connection required once set up |
83
-
|**Performance**| Consistent cloud-based performance | Depends on your machine capabilities |
84
-
|**Usage limits**| 60 hours free per month for personal accounts | No usage limits |
85
-
|**Environment consistency**| Identical setup for all contributors via devcontainers | May vary between different machines and OS |
76
+
The **devcontainer setup** uses a pre-configured development container that works identically whether you run it locally (via VS Code + Docker) or in the cloud (via GitHub Codespaces). All dependencies, database services, and tooling are pre-installed inside the container — useful if you want a zero-config environment or you're on Windows without WSL2.
86
77
87
-
Once you have decided, follow the relevant tab below to continue with the setup.
We have automated the development environment setup using devcontainers. With GitHub Codespaces, you get a consistent, ready-to-code environment that runs in your browser with all dependencies pre-installed.
78
+
<Asidetype='note'title='How do you decide which one?'>
95
79
96
-
**Launch a Codespace from your fork:**
97
-
98
-
<Steps>
99
-
100
-
1. Go to your fork at `https://github.com/YOUR_USER_NAME/freeCodeCamp`
80
+
<details>
101
81
102
-
2. Click the green **Code** button
82
+
<summary>
103
83
104
-
3. Select the **Codespaces** tab
84
+
Read the detailed comparision here
105
85
106
-
4. Click **Create codespace on main**
86
+
</summary>
107
87
108
-
Your codespace will automatically set up the development environment using our devcontainer configuration. This includes:
109
-
- Installing Node.js, pnpm, and all dependencies
110
-
- Setting up MongoDB
111
-
- Configuring VS Code extensions
112
-
- Preparing the environment variables
88
+
| Feature | Local Machine (Recommended) | Devcontainer |
@@ -265,42 +251,70 @@ You need a reference from your local clone to the `upstream` repository in addit
265
251
</Steps>
266
252
267
253
</TabItem>
268
-
</Tabs>
269
254
270
-
## Running freeCodeCamp
255
+
<TabItemlabel="Devcontainer"icon="seti:docker">
271
256
272
-
Now that you have a copy of freeCodeCamp, you can follow these instructions to run it. This will allow you to:
257
+
We have automated the development environment setup using devcontainers. The same container configuration works both locally (via VS Code + Docker) and in the cloud (via GitHub Codespaces), giving you a consistent, ready-to-code environment with all dependencies pre-installed.
273
258
274
-
- Preview edits to pages as they would appear on the learning platform.
275
-
- Work on UI related issues and enhancements.
276
-
- Debug and fix issues with the application servers and client apps.
259
+
#### Option A: Run locally with VS Code and Docker
Your Codespace comes pre-configured with all dependencies installed and services like the database already running. You can start developing immediately:
263
+
1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)and [Visual Studio Code](https://code.visualstudio.com/) if you haven't already.
282
264
283
-
1. In the terminal, run:
265
+
2. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code.
This will start both the API server and the client applications.
273
+
4. Open the cloned folder in VS Code. You should see a prompt to **Reopen in Container** — click it. Alternatively, press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac), type "Reopen in Container", and select the option.
290
274
291
-
2. Wait for the process to complete. It can take a few minutes, you will see a notification to for the `8000` port when it's ready.
275
+
5. Wait for the container to build and start. The devcontainer image has pre-cached dependencies, so this should be quick after the initial image pull. This includes:
276
+
- Pre-populated pnpm dependency cache and Turbo build cache for fast installs
277
+
- Setting up and seeding MongoDB
278
+
- Configuring VS Code extensions (ESLint, Prettier)
279
+
- Preparing the environment variables
292
280
293
-
3. Click on the notification to open the client application in a new browser tab.
281
+
</Steps>
294
282
295
-
<Asidetype='tip'title="Congratulations - you're all set!">
283
+
#### Option B: Run on GitHub Codespaces
296
284
297
-
You now have a copy of freeCodeCamp's entire learning platform running in your Codespace. Go ahead and start making changes to the codebase.
The default (basic) Codespaces machine type is not sufficient for running freeCodeCamp. Select at least a **4-core machine** when creating your Codespace.
298
288
299
289
</Aside>
300
290
291
+
<Steps>
292
+
293
+
1. Go to your fork at `https://github.com/YOUR_USER_NAME/freeCodeCamp`
294
+
295
+
2. Click the green **Code** button
296
+
297
+
3. Select the **Codespaces** tab
298
+
299
+
4. Click **Create codespace on main** (use the **...** menu to select a 4-core or larger machine type)
300
+
301
+
5. Wait for the setup to complete. The custom image has pre-cached dependencies, so this should be quick after the initial image pull.
302
+
303
+
</Steps>
304
+
301
305
</TabItem>
306
+
</Tabs>
302
307
303
-
<TabItemlabel="Local Machine"icon="laptop">
308
+
## Running freeCodeCamp
309
+
310
+
Now that you have a copy of freeCodeCamp, you can follow these instructions to run it. This will allow you to:
311
+
312
+
- Preview edits to pages as they would appear on the learning platform.
313
+
- Work on UI related issues and enhancements.
314
+
- Debug and fix issues with the application servers and client apps.
@@ -435,6 +449,34 @@ If you have issues with the setup, check out the [troubleshooting section](/trou
435
449
436
450
</Aside>
437
451
452
+
</TabItem>
453
+
454
+
<TabItemlabel="Devcontainer"icon="seti:docker">
455
+
456
+
Your devcontainer comes pre-configured with all dependencies installed and services like the database already running, whether you launched it locally via VS Code + Docker or in GitHub Codespaces. You can start developing immediately:
457
+
458
+
#### Option 1: VS Code task
459
+
460
+
Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac), type "Run Task", and select **Start Development**.
461
+
462
+
#### Option 2: Terminal
463
+
464
+
In the terminal, run:
465
+
466
+
```bash
467
+
pnpm run develop
468
+
```
469
+
470
+
Both options will start the API server and the client application.
471
+
472
+
Wait for the process to complete. It can take a few minutes, you will see a notification for the `8000` port when it's ready. Click on the notification to open the client application in a new browser tab.
473
+
474
+
<Asidetype='tip'title="Congratulations - you're all set!">
475
+
476
+
You now have a copy of freeCodeCamp's entire learning platform running in your devcontainer. Go ahead and start making changes to the codebase.
0 commit comments