# Install RenewCMS | RenewCMS Docs

> Start with Docker or a release binary, then verify your owner account.

Canonical page: https://renewcms.dev/en/resources/install

## Prepare the settings

Choose a CMS address for `PUBLIC_URL`. Use `http://localhost:8080` with `ENVIRONMENT=development` for a local trial. For a public instance, use the final HTTPS address and `ENVIRONMENT=production`.

Generate `JWT_SECRET` with `openssl rand -hex 32`. Keep this value private and stable across restarts. Set `SMTP_HOST`, `SMTP_PORT`, `SMTP_LOGIN`, `SMTP_PASSWORD` and `SMTP_SENDER` with the values from your mail provider. RenewCMS uses SMTP for verification and invitations.

Use this example as a starting point for a public installation. Replace the sample values with your CMS address, generated secret, and mail provider settings.

```dotenv
PUBLIC_URL=https://cms.example.com
ENVIRONMENT=production
JWT_SECRET=replace-with-generated-secret
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_LOGIN=cms@example.com
SMTP_PASSWORD=replace-with-mail-password
SMTP_SENDER=cms@example.com
```

## Start with Docker Compose

Run the first three lines in a terminal with Docker and Compose v2. Edit `docker.env` with your settings before running the last two lines. The health check should answer ok.

```bash
mkdir renewcms && cd renewcms
curl -fsSLO https://git.floriansylvain.fr/fsylvain/RenewCMS/raw/branch/main/docker-compose.yml
curl -fsSL https://git.floriansylvain.fr/fsylvain/RenewCMS/raw/branch/main/docker.env.example -o docker.env
docker compose up -d
curl -fsS http://localhost:8080/healthz
```

## Run the standalone binary

Download the release for your operating system and CPU (amd64 or arm64). Set the environment variables in your shell, make the file executable on Linux or macOS, and run it from the directory where you want to keep your data. On Windows, use the `.exe`. Check `/healthz` before opening the CMS.

For a permanent Linux installation, run the binary as a service under a dedicated user. Give that user write access to the paths in `DB_FILE` and `UPLOAD_DIR` and load the settings from a private systemd `EnvironmentFile`.

## Serve the CMS over HTTPS

Point DNS at your server and place a TLS reverse proxy such as Caddy in front of RenewCMS. Bind the Compose port to `127.0.0.1:8080:8080` when the proxy runs on the same host. For the binary, restrict direct access to the backend port with your firewall. Replace the host in this Caddyfile with your `PUBLIC_URL` hostname, then reload Caddy. Set `TRUSTED_PROXIES` to the proxy IP as seen by RenewCMS so rate limits use the forwarded client IP.

```caddyfile
cms.example.com {
    reverse_proxy localhost:8080 {
        header_up X-Real-IP {remote_host}
    }
}
```

## Create the owner account

Open `PUBLIC_URL` and register. The first account becomes the owner. Open the verification email and follow its link, then sign in. If the email is missing, check spam, the SMTP settings and the service logs.

## Keep a Linux binary running with systemd

Install the binary at `/opt/renewcms/renewcms`. Create a system user named renewcms and a writable `/var/lib/renewcms` directory owned by that user. Create `/etc/renewcms/renewcms.env` with permissions 600 and add the settings above, `DB_FILE=/var/lib/renewcms/renewcms.db` and `UPLOAD_DIR=/var/lib/renewcms/uploads`.

Save this unit as `/etc/systemd/system/renewcms.service`. Run `sudo systemctl daemon-reload`, then `sudo systemctl enable --now renewcms`. Check the service with `curl -fsS http://localhost:8080/healthz`.

```ini
[Unit]
Description=RenewCMS
After=network-online.target
Wants=network-online.target

[Service]
User=renewcms
Group=renewcms
WorkingDirectory=/var/lib/renewcms
EnvironmentFile=/etc/renewcms/renewcms.env
ExecStart=/opt/renewcms/renewcms
Restart=on-failure
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
```
