Questa guida fornisce le istruzioni per l'installazione del server ntfy su varie distribuzioni Linux, così come altri sistemi operativi. ntfy è un semplice servizio di notifica pub-sub basato su HTTP.
Questo metodo funziona su qualsiasi distribuzione Linux che supporti l'architettura specifica del tuo sistema.
Esegui uname -m per controllare la tua architettura:
x86_64 o amd64armv7 o armhfarm64 (aarch64)armv6Esempio per x86_64/amd64:
wget https://github.com/binwiederhier/ntfy/releases/download/v2.28.0/ntfy_2.28.0_linux_amd64.tar.gz
tar zxvf ntfy_2.28.0_linux_amd64.tar.gz
Esempio per armv7/armhf:
wget https://github.com/binwiederhier/ntfy/releases/download/v2.28.0/ntfy_2.28.0_linux_armv7.tar.gz
tar zxvf ntfy_2.28.0_linux_armv7.tar.gz
Esempio per arm64:
wget https://github.com/binwiederhier/ntfy/releases/download/v2.28.0/ntfy_2.28.0_linux_arm64.tar.gz
tar zxvf ntfy_2.28.0_linux_arm64.tar.gz
# Copy the binary to /usr/bin
sudo cp -a <architecture>/ntfy /usr/bin/ntfy
# Create config directory and copy files
sudo mkdir -p /etc/ntfy
sudo cp <architecture>/client/client.yml /etc/ntfy/
sudo cp <architecture>/server/server.yml /etc/ntfy/
sudo ntfy serve
Se si desidera che il server si avvii automaticamente all'avvio, utilizzare systemd.
systemctl --version).Copia il file Service Unit:
# Replace <architecture> with your system's architecture (e.g., amd64, armv7)
sudo mv <architecture>/server/ntfy.service /etc/systemd/system/
sudo chmod 644 /etc/systemd/system/ntfy.service
Ricarica Systemd e avvia il servizio:
sudo systemctl daemon-reload
sudo systemctl enable ntfy
sudo systemctl start ntfy
Verificare lo stato:
sudo systemctl status ntfy
Per i sistemi che usano OpenRC (ad esempio, Alpine Linux, Gentoo).
Copia lo script di servizio:
# Replace <architecture> with your system's architecture
sudo mv <architecture>/server/ntfy.openrc /etc/init.d/ntfy
sudo chmod 755 /etc/init.d/ntfy
Avvia il servizio:
sudo rc-service ntfy start
Aggiungi al livello di esecuzione predefinito (per avviare all'avvio):
sudo rc-update add ntfy default
Nota: A partire dalla fine del 2025, il repository ufficiale è stato spostato su archive.ntfy.sh. Il vecchio (heckel.io) è deprecato.
# Add keyring
sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/ntfy.gpg https://archive.ntfy.sh/apt/keyring.gpg
sudo apt install apt-transport-https
# Add repository
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/ntfy.gpg] https://archive.ntfy.sh/apt stable main" | sudo tee /etc/apt/sources.list.d/ntfy.list
# Update and Install
sudo apt update
sudo apt install ntfy
wget https://github.com/binwiederhier/ntfy/releases/download/v2.28.0/ntfy_2.28.0_linux_amd64.deb
sudo dpkg -i ntfy_*.deb
sudo systemctl enable ntfy
sudo systemctl start ntfy
# Install RPM
sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v2.28.0/ntfy_2.28.0_linux_amd64.rpm
# Enable and Start
sudo systemctl enable ntfy
sudo systemctl start ntfy
paru -S ntfysh-bin
curl https://aur.archlinux.org/cgit/aur.git/snapshot/ntfysh-bin.tar.gz | tar xzv
cd ntfysh-bin
makepkg -si
services.ntfy-sh.enable = true; al tuo /etc/nixos/configuration.nix ed esegui nixos-rebuild switch.nix-env -iA ntfy-shpkg install go-ntfy
macOS supporta la CLI (ntfy publish, ntfy subscribe) ma non supporta il server tramite pacchetti ufficiali.
curl -L https://github.com/binwiederhier/ntfy/releases/download/v2.28.0/ntfy_2.28.0_darwin_all.tar.gz > ntfy.tar.gz
tar zxvf ntfy.tar.gz
sudo cp -a ntfy_2.28.0_darwin_all/ntfy /usr/local/bin/ntfy
mkdir ~/Library/Application\ Support/ntfy
cp ntfy_2.28.0_darwin_all/client/client.yml ~/Library/Application\ Support/ntfy/client.yml
Nota: Per eseguire il server su macOS, è necessario compilarlo manualmente utilizzando Go (vedere Istruzioni di compilazione).
brew install ntfy
Questo installa solo la CLI. L'installazione del server richiede passaggi manuali.
ntfy.exe nel tuo %Path% (ad esempio, C:\Program Files\).ntfy.exe -h
sc create ntfy binPath="C:\path\to\ntfy.exe serve" start=auto
sc start ntfy
docker run -p 80:80 -it binwiederhier/ntfy serve
docker run \
-v /var/cache/ntfy:/var/cache/ntfy \
-p 80:80 \
-it \
binwiederhier/ntfy \
serve \
--cache-file /var/cache/ntfy/cache.db
docker run \
-v /etc/ntfy:/etc/ntfy \
-e TZ=UTC \
-p 80:80 \
-u UID:GID \
-it \
binwiederhier/ntfy \
serve
version: '3'
services:
ntfy:
image: binwiederhier/ntfy
container_name: ntfy
command: ["serve"]
environment:
- TZ=UTC
user: "1000:1000" # Replace with your UID/GID
volumes:
- /var/cache/ntfy:/var/cache/ntfy
- /etc/ntfy:/etc/ntfy
ports:
- "80:80"
healthcheck:
test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"]
interval: 60s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
init: true
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ntfy
spec:
serviceName: ntfy
replicas: 1
selector:
matchLabels:
app: ntfy
template:
metadata:
labels:
app: ntfy
spec:
containers:
- name: ntfy
image: binwiederhier/ntfy
args: ["serve", "--cache-file", "/var/cache/ntfy/cache.db"]
ports:
- containerPort: 80
name: http
volumeMounts:
- name: config
mountPath: /etc/ntfy
readOnly: true
- name: cache
mountPath: /var/cache/ntfy
volumes:
- name: config
configMap:
name: ntfy
- name: cache
persistentVolumeClaim:
claimName: ntfy-cache
---
apiVersion: v1
kind: Service
metadata:
name: ntfy
spec:
selector:
app: ntfy
ports:
- port: 80
targetPort: 80
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ntfy-cache
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
sudo journalctl -u ntfy (systemd) o sudo rc-service ntfy status (OpenRC).server.yml o nel comando di esecuzione di Docker (-p 8080:80)./etc/ntfy/client.yml (o ~/.config/ntfy/client.yml per i non-root)./etc/ntfy/server.yml.Modifica questi file per personalizzare impostazioni come il fuso orario, la dimensione massima dei messaggi o i criteri di conservazione.
user in Docker o servizio systemd).Per ulteriori dettagli, visitare il ntfy GitHub Repository.
Dopo aver acquistato questa applicazione su Esadax, ti verrà richiesto di fornire i parametri di configurazione qui sotto. Esadax aggiunge le variabili fornite al deployment in modo che l'applicazione possa essere lanciata con la configurazione richiesta.
| Parametri | Descrizione |
|---|---|
ADMIN_USERNAME |
Valore fornito alla distribuzione per ADMIN_USERNAME. |
ADMIN_PASSWORD |
Valore fornito alla distribuzione per ADMIN_PASSWORD. |
Una volta configurati i valori, fare clic su Distribuisci per avviare l'applicazione. L'applicazione acquistata utilizzerà i valori di configurazione forniti, incluse le credenziali come nomi utente e password quando vengono forniti tali parametri.