Skip to main content
Chartbrew uses two public addresses: one for the client and one for the API. Choose Apache, Nginx, or Caddy on the same Linux server as Chartbrew. Run only one of these proxies on ports 80 and 443. If your provider manages the proxy and certificates, apply the same URL settings through its controls.

Before you start

  • Complete the Docker or source installation.
  • Point DNS records for charts.example.com and charts-api.example.com to the server. Replace these names throughout this guide.
  • Allow incoming HTTP and HTTPS traffic on ports 80 and 443. Keep application, database, and Redis ports private.
Set these production values before you build the client:
For a source installation, set CB_API_HOST=127.0.0.1 and CB_API_PORT=4019. Inside Docker, keep CB_API_HOST=0.0.0.0 and bind the published ports to the host’s loopback address.

Configure your web server

Use Apache 2.4.47 or later for WebSocket upgrades through mod_proxy_http.

Install and configure Apache

On Ubuntu, install Apache and enable the proxy modules:
Save this configuration as /etc/apache2/sites-available/chartbrew.conf:
The Socket.IO rule must precede the general API rule. See Apache’s WebSocket upgrade support.Enable the site and check the configuration before reloading:

Enable HTTPS

Follow the Certbot instructions for Apache and your operating system. Once Certbot is installed, request certificates for both hostnames:
Enable HTTP-to-HTTPS redirects. Check that the resulting HTTPS virtual hosts retain the client, API, and Socket.IO proxy rules.

Apply URL changes

Rebuild the client and restart the API if you changed the public URLs. For Docker, recreate the application container as described in the Docker guide.

Check the public URLs

Open the client through HTTPS and sign in. Refresh a chart and check that the browser calls the HTTPS API URL. Test a public report and an embedded chart. If your proxy adds a header that blocks embedding, change that rule only for the report or chart routes you intend to embed. Do not remove frame protection from the entire application. Also check the Chartbrew sharing policy and token used by the embed.