Deploy ntfy-latest
Deploy and Host ntfy-latest with Railway
Just deployed
/var/lib/ntfy
Deploy and Host ntfy-latest on Railway
ntfy-latest is the newest stable build of ntfy, a lightweight publish/subscribe notification server. It allows you to send push-style messages to devices, scripts, and services using HTTP. Messages can be sent from shell scripts, automation tools, CI/CD, or backend applications, and clients can receive notifications instantly via web, CLI, mobile apps, or integrations.
About Hosting ntfy-latest
Hosting ntfy-latest on Railway gives you a running notification server without managing hardware or complex infrastructure. Incoming messages are published to topics, and any subscribed devices or processes receive them in real time. Railway supports mounting a persistent volume so ntfy can safely store authentication databases, message cache files, and optional file attachments. You can run ntfy publicly, privately, or internally depending on your configuration. Text-only notifications work immediately without external setup. File-attachment support requires a valid base-url and persistent storage, but remains optional.
Common Use Cases
- Send automated deployment or server alerts to your phone or browser
- Build internal tooling that posts CI/CD or monitoring notifications
- Connect IoT or automation devices for lightweight messaging
Dependencies for ntfy-latest Hosting
- A running container platform (Railway automatically provides this)
- A persistent Railway volume to store:
- authentication database
- message cache
- optional attachment files
Deployment Dependencies
- ntfy-latest Docker image
- Railway persistent storage (recommended)
- Optional: a public domain (only required if you enable file attachments)
Environment Variables for ntfy-latest on Railway
These variables control how your ntfy deployment behaves:
Required
| Variable | Description |
|---|---|
PORT | The port ntfy listens on. Railway typically sets this to 80 for HTTP routing. |
Authentication & Permissions
| Variable | Description |
|---|---|
NTFY_AUTH_FILE | Path to the authentication database. Users and access rules persist only if stored on a persistent volume. |
NTFY_AUTH_DEFAULT_ACCESS | Default access policy for topics. Options include: deny-all, read-only, write-only, or read-write. deny-all keeps topics private unless explicitly allowed. |
NTFY_ENABLE_LOGIN | Enables user login support in the web interface. |
NTFY_ENABLE_SIGNUP | Controls whether new users can create accounts themselves. For private services, set this to false. |
Message & Cache Storage
| Variable | Description |
|---|---|
NTFY_CACHE_FILE | Path to the SQLite cache used for message history. Stored on the persistent volume so it survives restarts. |
Attachment Storage (Optional)
| Variable | Description |
|---|---|
NTFY_ATTACHMENT_CACHE_DIR | Local folder where uploaded notification files are stored. Only needed if you want file attachments. If this is set, you MUST set NTFY_BASE_URL. |
URL Configuration (Important)
| Variable | Description |
|---|---|
NTFY_BASE_URL | The public-facing base URL for your ntfy instance. Used to generate file-access URLs for attachments. Must be a simple URL like https://yourservice.up.railway.app with no trailing slash and no path. If you are not using file attachments, leave this undefined. |
NTFY_BEHIND_PROXY | Set to true if Railway or a reverse proxy terminates HTTPS. Controls header handling for forwarded requests. |
Timezone (Optional)
| Variable | Description |
|---|---|
TZ | Optional. Overrides the container timezone for logs and message timestamps. If not set, ntfy defaults to UTC. |
Example Railway Environment For Text-Only Notifications (No Domain Needed)
PORT="80"
NTFY_BEHIND_PROXY="false"
NTFY_AUTH_FILE="/var/lib/ntfy/auth.db"
NTFY_AUTH_DEFAULT_ACCESS="deny-all"
NTFY_ENABLE_LOGIN="true"
NTFY_ENABLE_SIGNUP="false"
NTFY_CACHE_FILE="/var/lib/ntfy/cache.db"
# NOTE: Do NOT define NTFY_BASE_URL or NTFY_ATTACHMENT_CACHE_DIR unless you want file uploads
Important rules for this configuration:
NTFY_BASE_URL must be a full hostname with no trailing slash (Example: https://your-ntfy-service.up.railway.app)
You must mount a persistent Railway volume at /var/lib/ntfy
Attachments will be accessible over HTTP using generated URLs
Why Deploy ntfy-latest on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying ntfy-latest on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
