# Developing Discourse on GitHub Codespaces

**URL:** https://meta.discourse.org/t/developing-discourse-on-github-codespaces/336131
**Category:** Developer Guides
**Created:** [November 14, 2024, 12:12pm UTC](https://meta.discourse.org/t/developing-discourse-on-github-codespaces/336131 "2024-11-14T12:12:38Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 14, 2024, 12:12pm UTC](https://meta.discourse.org/t/developing-discourse-on-github-codespaces/336131/1 "2024-11-14T12:12:38Z")

</div>

[GitHub Codespaces](https://github.com/features/codespaces) is a very fast way to get started with Discourse development. Their free tier is good for 30 hours per month of a 4-core machine.

# Getting Started

1. Navigate to [the github repository](https://github.com/discourse/discourse)

2. Press the , (comma) key on your keyboard, to open GitHub codespaces

3. Use ‘change options’ to customize the machine. Technically, the 2-core machine will work, but we recommend using at least 4-core for a better experience.

4. Click “Create Codespace”

5. Wait for the container to download and start. When it’s done, the README will appear, and you’ll see the Discourse filesystem in the sidebar.

6. Run the default build task using Cmd/Ctrl + Shift + B.

7. Run the `dev/admin/create` task. Open the command palette with Cmd/Ctrl + Shift + P and search for “Tasks: Run Tasks”. It will present a menu of tasks; select `dev/admin/create` off of that list. You’ll be prompted to enter an email address and a password for your admin user.

8. Visit the “Ports” tab, and click the :globe_with_meridians: button for port 3000. This will open a new tab showing your development copy of Discourse

9. All done! You can now make changes in the codespace and see them reflected in the preview.

The VSCode environment will automatically be configured with our recommended settings and extensions, including automatic linting and formatting.

To minimize usage, make sure to run “Codespaces: Stop Current Codespace” from the command palette (Ctrl + Shift + P or Cmd + Shift + P) when you’re finished. If you forget to do this, the Codespace _should_ be shut down automatically after your account’s configured idle time (default 30 mins). But, there are some situations where the codespace will not be detected as idle, so it’s best to stop it deliberately.

## Running tests

The first time you run tests, you’ll need to install testing dependencies, including Playwright and the `discourse_test` DB. You can run the `deps/testing` task to install those. Open the command palette, select “Tasks: Run Tasks”. It will present a menu of tasks; select `deps/testing` off of that list.

Once the test dependencies are installed, you can run [`bin/lint`](https://meta.discourse.org/t/132947), [`bin/qunit`](https://meta.discourse.org/t/66857), or the [system specs](https://meta.discourse.org/t/325937)

# Tips

- You can launch a codespace from specific branches/PRs - just visit it, and press ,

- You can manage all your codespaces at [Sign in to GitHub · GitHub](https://github.com/codespaces/)

- Discourse’s sample vscode `.vscode/settings.json` and `.vscode/tasks.json` will be copied when you first boot the codespace. From that point forward, if you want to use the latest sample config, you’ll need to manually copy `.vscode/settings.json.sample` to `.vscode/settings.json`.

* * *

This document is version controlled - suggest changes [on github](https://github.com/discourse/discourse/blob/main/docs/developer-guides/docs/02-development-environments/02-github-codespaces.md).

---

_[View the full topic](https://meta.discourse.org/t/developing-discourse-on-github-codespaces/336131)._
