-
-
Notifications
You must be signed in to change notification settings - Fork 85
Install_RedHat9
Chris Caron edited this page May 10, 2025
·
1 revision
This guide explains how to install Apprise API on Red Hat Enterprise Linux 9 or Rocky Linux 9, configure it to run as a systemd service with Gunicorn, and use NGINX to serve static files and proxy traffic — required for Django to operate in production mode.
This tutorial can also be adapted to:
- Rocky Linux 9.x
- Oracle Linux 9.x
Install required system packages:
sudo dnf install -y python3 python3-pip python3-virtualenv git nginxEnable and start the NGINX service:
sudo systemctl enable --now nginxcd /opt
sudo git clone https://github.com/caronc/apprise-api.git
cd apprise-api
# Optional: assign proper ownership
sudo chown -R nginx:nginx .python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtCreate the unit file:
sudo nano /etc/systemd/system/apprise.servicePaste this:
[Unit]
Description=Apprise API Service
After=network.target
[Service]
User=nginx
Group=nginx
WorkingDirectory=/opt/apprise-api
ExecStart=/opt/apprise-api/venv/bin/gunicorn apprise_api.wsgi:application \
--bind 127.0.0.1:8000 \
--chdir /opt/apprise-api
Restart=on-failure
[Install]
WantedBy=multi-user.targetReload systemd and enable the service:
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable --now appriseEdit or create the file:
sudo nano /etc/nginx/conf.d/apprise.confUse this structure (based on official example):
server {
listen 80;
server_name your.domain.com;
location /static/ {
alias /opt/apprise-api/static/;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}Enable and start NGINX:
ssudo nginx -t
sudo systemctl reload nginxVisit https://127.0.0.1 and see if the Apprise API loads up okay.
- App directory:
/opt/apprise-api - Static files:
/opt/apprise-api/static/ - Gunicorn logs:
journalctl -u apprise - NGINX logs:
/var/log/nginx/access.logand/var/log/nginx/error.log
Ensure the user (www by default) has permission to access/write these.
# Manage Apprise API
sudo systemctl start apprise
sudo systemctl restart apprise
sudo systemctl stop apprise
sudo systemctl status apprise
# Manage NGINX
sudo systemctl restart nginx