To run HedgeDoc 2.0 you need three components: the backend, the frontend and the reverse proxy.
Backend and Frontend are included in the [HedgeDoc repo](https://github.com/hedgedoc/hedgedoc). The reverse proxy can be chosen by preference. For development, we
recommend caddy and the provided configuration.
## Quick guide for development setup
This describes the easiest way to start a local development environment. For other deployments follow the description
below.
To run HedgeDoc 2.0 you need three components: the backend, the frontend and the reverse proxy.
Backend and Frontend are included in the [HegdeDoc repo](https://github.com/hedgedoc/hedgedoc). The reverse proxy can be chosen by preference. For development, we
- [Download](https://caddyserver.com/) and place the `caddy` binary in `hedgedoc/dev-reverse-proxy`. Ensure it is executable with `chmod +x caddy`. Users of macOS may need to run `xattr -d com.apple.quarantine ./caddy` to lift the quarantine for executables from the internet.
- Install Caddy using your package manager
4. Install the dependencies in repo root directory with `yarn install`
5. Goto `hedgedoc/backend` directory with `cd backend`
6. Create the `.env` config file by copying the example: `cp .env.example .env`
7. Add a value to `HD_SESSION_SECRET` in the .env file. This can be any string, which has to be a secure password for production but can be set to simple string for debug purpose.
8. Execute the following lines
```shell
echo "HD_AUTH_LOCAL_ENABLE_LOGIN=true" >> .env
echo "HD_AUTH_LOCAL_ENABLE_REGISTER=true" >> .env
```
9. Go back into the root directory with `cd ..`
10. Run `yarn start:dev`
> This will execute the backend, frontend and reverse proxy at once
11. Use your browser to go to <http://localhost:8080>
## More detailed development setup
The following sections describe a more detailed setup of all components.
**Note:** The backend can be mocked instead of starting it for real. This is useful, if you just want to work on the frontend. See the "Mocked backend" section below.
1. Download the latest version of Caddy from [the Caddy website](https://caddyserver.com/) or alternatively install it
using your package manager. You don't need any plugin. Place the downloaded binary in the
directory `dev-reverse-proxy`. Don't forget to mark the file as executable using `chmod +x caddy`. Users of macOS may need to run `xattr -d com.apple.quarantine ./caddy` to lift the quarantine for executables from the internet.
2. Start Caddy using `./caddy run` (if you downloaded the binary manually) or `caddy run` (if you installed Caddy via a package manager).