Manual Installation
Warning: Gotcha ahead!
Broadcast can also be installed manually on your server with the Docker image.
This method is more complex than the automation installation method, and so this is not recommended for most users. However, there are specific reasons why you might want to manually install and run Docker.
First, let’s talk about what functionalities are not available with the manual installation method.
Features not available with manual installation
1. Auto updates
You will need to manually update the Docker image to get the latest features and security updates. See below for examples on how to do this manually.
2. Backups
Automatic backups are not supported as this feature requires creating system services. You will need to manually backup the database or set up some script to do it for you. Below, we provide you with some example scripts to help you get started.
3. Reverse proxy / multi-domains / SSL termination
You can still use multiple domains on a single server with Broadcast, but you will need to manually set up your server’s reverse proxy to handle this for you.
For example, if you are using Nginx or Caddy, you will need to manually set up the reverse proxy to handle the multiple domains.
You will also need to manually set up your SSL certificates.
Steps to manually install and run Broadcast
1. Create a directory to run Broadcast
Clone the Broadcast script file to your server:
git clone https://github.com/Furvur/broadcast-script.git /home/your-user/broadcast
Replace your-user
with the username of the user account on your server.
Be careful to not run the broadcast.sh
script, as that is used for the automation installation method.
2. Modify the docker-compose.manual.yml file
There is a docker-compose.manual.yml
file in the cloned repository.
The file looks like this:
# docker-compose.manual.yml
services:
app:
image: ${DOCKER_IMAGE:-gitea.hostedapp.org/broadcast/broadcast:latest}
platform: linux/${TARGETARCH:-amd64}
pull_policy: always
container_name: app
restart: always
env_file:
- /home/replace-with-your-user/broadcast/app/.env
volumes:
- /home/replace-with-your-user/broadcast/app/storage:/rails/storage
- /home/replace-with-your-user/broadcast/app/uploads:/rails/uploads
ports:
- "127.0.0.1:3000:3000" # Overrides default ports
networks:
- broadcast-network
depends_on:
postgres:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
command: bin/rails server # Overrides default command
job:
image: ${DOCKER_IMAGE:-gitea.hostedapp.org/broadcast/broadcast:latest}
platform: linux/${TARGETARCH:-amd64}
pull_policy: always
container_name: job
restart: always
env_file:
- /home/replace-with-your-user/broadcast/app/.env
volumes:
- /home/replace-with-your-user/broadcast/app/storage:/rails/storage
networks:
- broadcast-network
depends_on:
postgres:
condition: service_healthy
command:
- "bin/jobs"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
postgres:
image: postgres:17-alpine
container_name: postgres
restart: always
env_file:
- /home/replace-with-your-user/broadcast/db/.env
volumes:
- /home/replace-with-your-user/broadcast/db/backups:/backups
- /home/replace-with-your-user/broadcast/db/postgres-data:/var/lib/postgresql/data
- /home/replace-with-your-user/broadcast/db/init-scripts:/docker-entrypoint-initdb.d
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U broadcast"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- broadcast-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
broadcast-network:
driver: bridge
Broadcast replies on 3 containers to run:
- The app container
- The job container
- The postgres container
The names of these containers should be self explanatory.
Certain volumes need to be mounted from your host machine to the containers in order to persist data.
3. Create the .env files
You will need to create the .env
files for the app/job and db containers.
The app and db containers share the same .env
file, which is located in the /home/your-user/broadcast/app
directory.
Copy the sample files from /home/your-user/broadcast/manual
to the respectively app and db directories.
There is some duplicate in the both the app and db .env
files, so be careful to copy the correct values.
You will need to generate a SECRET_KEY_BASE
value for the app container.
To do this, run the following command in the /home/your-user/broadcast/app
directory:
openssl rand -hex 64
The value that is generated can be used for the SECRET_KEY_BASE
variable in the .env
file.
Next, you will need to generate a POSTGRES_PASSWORD
value.
To do this, run the following command:
openssl rand -hex 32
Copy this value into both the the app and db .env
files. Note that in the app .env
file, the password variable is called DATABASE_PASSWORD
, and that in the db .env
file, the password variable is called POSTGRES_PASSWORD
.
Next, set the TLS_DOMAIN
and LICENSE_KEY
values to the domain name of your server and the license key you got from the customer dashboard.
4. Run the docker compose file
Before you can run the docker compose file, you will need to ensure that Docker is already installed on your server. As well, you will need to be logged into Broadcast’s private Docker registry:
docker login gitea.hostedapp.org
Please email us to get access to the private Docker registry as you will need a username and password to log in.
Test running the Broadcast containers together with the following command:
docker compose -f docker-compose.manual.yml up
This should boot up the three containers and start the Broadcast app.
5. Setup monitored services
Once you have confirmed that everything is working correctly, press CTRL+C to stop the containers.
Next, you will need to setup monitored services for the containers.
If you are on a Linux system, you want to use systemd to manage running the containers.
For example, if you’re using systemd, you can create a new service file for the Broadcast containers.
[Unit]
Description=Broadcast
Requires=docker.service
After=docker.service
[Service]
Type=simple
ExecStart=/bin/bash -c "docker compose -f /home/your-user/broadcast/docker-compose.yml up"
ExecStop=/bin/bash -c "docker compose -f /home/your-user/broadcast/docker-compose.yml down"
Restart=always
User=<your-user>
WorkingDirectory=/opt/broadcast
[Install]
WantedBy=multi-user.target