Prerequisites
- Text Editor (VSCode, Neovim, etc.)
- NodeJS v20.10.0
- NPM v10.2.3 (or similar)
- Go v1.23.1
- Git
- Docker & Docker Compose
Setup Your Repository
Below is an example if you’re working on the Pangolin repository.2
Add upstream remote
Add the remote
upstream
:3
Create feature branch
Create a new branch:
It is recommended to give your branch a meaningful name, relevant to the feature or fix you are working on.Good examples:
docs-docker
feature-new-system
fix-title-cards
bug
docs
feature
fix
patch
4
Open pull request
If you open a pull request, open it against the
dev
branch of the original repository.Pangolin Development Setup
Choose your preferred development approach. We strongly recommend Docker Compose for the most consistent experience across all platforms.Option 1: Docker Compose (Recommended)
Advantages
- Consistent environment
- Easy setup and teardown
- Isolated dependencies
- Works on any OS
Requirements
- Docker installed
- Docker Compose installed
- 4GB+ RAM available
1
Install dependencies
Install package dependencies:
2
Configure environment
Ensure you have a
config/
directory at the root with a config.yml
inside. Refer to the Pangolin Configuration docs or the config.example.yml
in the repo for a sample of what to include in that file.You may need to tweak this to run in dev, such as setting the
dashboard_url
to http://localhost:3002
.3
Generate database schema
Generate the database schema and push it:
4
Start development server
Start the development server using Docker Compose:
This will build and start all services in development mode with hot reloading enabled.
When running Pangolin for the first time there will be no exit nodes. This means that there have been no Gerbil “exit nodes” registered in the database. When Gerbil first starts up and requests its config from Pangolin for the first time it gets registered as an exit node.The easiest way to resolve this is to run Gerbil and have it register in your dev environment. Download the Gerbil binary and run it with localhost:
Option 2: Local Development
Local development requires more setup and may have environment-specific issues. Docker Compose is recommended for consistency.
1
Install dependencies
Install package dependencies:
2
Configure environment
Ensure you have a
config/
directory at the root with a config.yml
inside. Refer to the Pangolin Configuration docs or the config.example.yml
in the repo for a sample of what to include in that file.You may need to tweak this to run in dev, such as setting the
dashboard_url
to http://localhost:3002
.3
Generate database schema
Generate the database schema and push it:
4
Start development server
Start the development server:
Windows Development Considerations
Windows users with Docker Desktop + WSL2: File change detection may not work properly when project files are stored on the Windows filesystem.
Best performance and compatibilityReference Links
-
Where to store your project files:
- For best performance, always store your project inside the Linux filesystem of your Docker or Default WSL2 instance, e.g.
/home/<user>/pangolin
. - If other WSL instances are used, ensure the Docker Desktop WSL integration is enabled for that distribution.
- For further information, see Link Section below.
- For best performance, always store your project inside the Linux filesystem of your Docker or Default WSL2 instance, e.g.
-
Accessing WSL2 files from Windows:
- You can access your WSL2 home directory from Windows using the UNC path:
\\wsl$\<DistroName>\home\<user>\pangolin
(replace<DistroName>
with your actual WSL distribution, e.g.Ubuntu-22.04
). - This path works in Windows Explorer, VS Code, and other Windows applications. You can drag & drop files, create shortcuts, or map a network drive for convenience.
- Note: This UNC path is for Windows tools only. Do not use it for Docker container mounts.
- You can access your WSL2 home directory from Windows using the UNC path:
-
How to mount WSL2 files in Docker containers:
- Always use the absolute Linux path from inside WSL2 for Docker volumes. This is the only method fully supported and recommended by Docker.
- Correct Docker Compose example:
- Correct docker run example:
- Never use
\\wsl$
or Windows paths (e.g./mnt/c/...
) for Docker volumes when running with the WSL2 backend. This is not supported and can lead to poor performance or errors. - File watchers and hot reload works natively when your project is inside the WSL2 filesystem and mounted using the Linux path.
You may want to use the VS Code Remote - WSL extension or VS Code Remote - SSH Extension to open your project folder directly in VSCode from the WSL/Remote Filesystem for seamless Development.
Component Development
Gerbil
Requirements
- Go v1.23.1
Newt
Requirements
- Go v1.23.1
Olm
Requirements
- Go v1.23.1