The .env file is a plain text configuration file. You need to set three things: your domain name, your admin email, and a strong secret key. Open the file with nano (a simple text editor), find each line, and replace the placeholder values. The secret key can be any long random string — the command below generates one for you.
$ cd ~/peertube && SECRET=$(openssl rand -hex 32) && sed -i "s|PEERTUBE_SECRET=.*|PEERTUBE_SECRET=${SECRET}|" .env && nano .env
What you should see
nano opens the .env file. Look for PEERTUBE_WEBSERVER_HOSTNAME and set it to your domain (e.g. video.yourdomain.com). Set PEERTUBE_ADMIN_EMAIL to your email. PEERTUBE_SECRET is already filled in. Save with Ctrl+O then Enter, exit with Ctrl+X.
This might happen
You forget to change PEERTUBE_WEBSERVER_HOSTNAME and the site loads with a wrong URL or SSL fails
Re-open .env with nano, fix the hostname, then run docker compose down && docker compose up -d to restart