-
-
Notifications
You must be signed in to change notification settings - Fork 86
Install_Ubuntu24
Chris Caron edited this page May 10, 2025
·
3 revisions
This guide details how to install Apprise API on Ubuntu 24.04 LTS, run it as a systemd service, and use NGINX to serve static files and proxy requests to Gunicorn — required for a proper production deployment.
Install system packages:
sudo apt update
sudo apt install -y python3 python3-pip python3-venv git nginxVerify installations:
python3.9 --version
pip3.9 --version
git --versioncd /opt
sudo git clone https://github.com/caronc/apprise-api.git
cd apprise-api
# Optional: Set ownership to the www-data user
sudo chown -R www-data:www-data .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=www-data
Group=www-data
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/sites-available/appriseapiUse 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:
sudo ln -s /etc/nginx/sites-available/appriseapi /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart 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 the service
sudo systemctl status appriseapi
sudo systemctl restart appriseapi
sudo systemctl stop appriseapi
# Check NGINX status
sudo systemctl status nginx