Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions contents/handbook/engineering/developing-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,7 @@

In case some steps here have fallen out of date, please tell us about it – feel free to [submit a patch](https://github.com/PostHog/posthog.com/blob/master/contents/handbook/engineering/developing-locally.md)!

## Option 1: Developing with Codespaces

This is a faster option to get up and running. If you don't want to or can't use Codespaces, continue from the next section.

1. Create your codespace.
![](https://user-images.githubusercontent.com/890921/231489405-cb2010b4-d9e3-4837-bfdf-b2d4ef5c5d0b.png)
2. Update it to 8-core machine type (the smallest is probably too small to get PostHog running properly).
![](https://user-images.githubusercontent.com/890921/231490278-140f814e-e77b-46d5-9a4f-31c1b1d6956a.png)
3. Open the codespace, using one of the "Open in" options from the list.
4. In the codespace, open a terminal window and run `docker compose -f docker-compose.dev.yml up`.
5. Ensure that you are using the right Node version (`nvm install 22 && nvm use 22`) then, in another terminal, run `pnpm i` (and use the same terminal for the following commands).
6. Then run `uv sync`
- If this doesn't activate your python virtual environment, run `uv venv` (install `uv` following the [uv standalone installer guide](https://docs.astral.sh/uv/getting-started/installation/#standalone-installer) if needed)
7. Install `sqlx-cli` with `cargo install sqlx-cli` (install Cargo following the [Cargo getting started guide](https://doc.rust-lang.org/cargo/getting-started/installation.html) if needed)
8. Now run `DEBUG=1 ./bin/migrate`
9. Install [mprocs](https://github.com/pvolok/mprocs#installation) (`cargo install mprocs`)
10. Run `./bin/start`.
11. Open browser to <http://localhost:8010/>.
12. To get some practical test data into your brand-new instance of PostHog, run `DEBUG=1 ./manage.py generate_demo_data`.

## Option 2: Developing locally
## Option 1: Developing locally

### Prerequisites

Expand Down Expand Up @@ -445,6 +425,27 @@

You can now change PostHog in any way you want. See [Project structure](/handbook/engineering/project-structure) for an intro to the repository's contents. To commit changes, create a new branch based on `master` for your intended change, and develop away.

## Option 2: Developing with Codespaces

This is a fast option to get up and running in a remote environment.

1. Create your codespace.
![](https://user-images.githubusercontent.com/890921/231489405-cb2010b4-d9e3-4837-bfdf-b2d4ef5c5d0b.png)
2. Update it to 8-core machine type (the smallest is probably too small to get PostHog running properly).
![](https://user-images.githubusercontent.com/890921/231490278-140f814e-e77b-46d5-9a4f-31c1b1d6956a.png)
3. Open the codespace, using one of the "Open in" options from the list.
4. In the codespace, open a terminal window and run `docker compose -f docker-compose.dev.yml up`.
5. Ensure that you are using the right Node version (`nvm install 22 && nvm use 22`) then, in another terminal, run `pnpm i` (and use the same terminal for the following commands).
6. Then run `uv sync`
- If this doesn't activate your python virtual environment, run `uv venv` (install `uv` following instructions [here](https://docs.astral.sh/uv/getting-started/installation/#standalone-installer) if needed)

Check failure on line 440 in contents/handbook/engineering/developing-locally.md

View workflow job for this annotation

GitHub Actions / Lint Markdown Files

Link text should be descriptive

contents/handbook/engineering/developing-locally.md:440:117 MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"] https://github.com/DavidAnson/markdownlint/blob/v0.39.0/doc/md059.md
7. Install `sqlx-cli` with `cargo install sqlx-cli` (install Cargo following instructions [here](https://doc.rust-lang.org/cargo/getting-started/installation.html) if needed)

Check failure on line 441 in contents/handbook/engineering/developing-locally.md

View workflow job for this annotation

GitHub Actions / Lint Markdown Files

Link text should be descriptive

contents/handbook/engineering/developing-locally.md:441:92 MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"] https://github.com/DavidAnson/markdownlint/blob/v0.39.0/doc/md059.md
8. Now run `DEBUG=1 ./bin/migrate`
9. Install [mprocs](https://github.com/pvolok/mprocs#installation) (`cargo install mprocs`)
10. Run `./bin/start`.
11. Open browser to <http://localhost:8010/>.
12. To get some practical test data into your brand-new instance of PostHog, run `DEBUG=1 ./manage.py generate_demo_data`.


## Testing

For a PostHog PR to be merged, all tests must be green, and ideally you should be introducing new ones as well – that's why you must be able to run tests with ease.
Expand Down
Loading