/c4d-packer

VM images with Coder + Caddy for automatic TLS.

Primary LanguageHCL

Coder VM images

Deploy to DO

VM images with Coder + Caddy for automatic TLS.

Coder workspaces

By default, Coder will run on your public IPv4 address with a self-signed certificate: https://your_droplet_public_ipv4/login.

Use the credentials below to login to your Coder workspace. Upon logging in, you will be prompted to change your password.

Username: admin
Password: coder12345

Add a domain (optional)

  1. Point your DNS records (coder.yourdomain.com *.coder.yourdomain.com) to the Droplet's public IPv4 address.
  2. Navigate to the domain, Caddy should automatically provision a TLS certificate. (we recommend using an incognito window in the beginning to initial caching issues)

Enable dev URLs (optional)

  1. SSH into your VM: ssh root@your_droplet_public_ipv4

  2. Follow instructions to modify coder/docker-compose.yaml and set

    - DEVURL_HOST=*.coder.yourdomain.com
  3. Modify coder/Caddyfile to specify your email address for LetsEncrypt.

  4. Restart Coder and Caddy:

    cd $HOME/coder && docker-compose restart

Harden your configuration (recommended)

  1. SSH into your Droplet: ssh root@your_droplet_public_ipv4

  2. Follow instructions to modify coder/Caddyfile to disable "internal" (self-signed) certificates and add your email for LetsEncrypt.

  3. Replace https:// { with coder.yourdomain.com, *.coder.yourdomain.com { to limit the proxy to your domain(s).

  4. Restart Coder and Caddy:

    cd $HOME/coder && docker-compose restart

Use a wildcard certificate

By default, Caddy's On-Demand TLS will be used to generate certificates for dev URLs. This zero-configuration options works well, but introduces ~10 second delays or rate limiting when a developer visits a newly-created dev URL.

For best results, consider configuring ZeroSSL with Caddy or build a Caddy image with the module for your DNS provider.

Stay tuned for a future release with improved steps for wildcard/custom certificates.

Use a managed Postgres database (optional)

  1. SSH into your Droplet: ssh root@your_droplet_public_ipv4

  2. Modify coder/docker-compose.yaml and follow our docs to configure your managed database with Coder for Docker.

  3. Restart Coder and Caddy:

    cd $HOME/coder && docker-compose restart

Stay tuned for a future release more support for service-provided Postgres databases.