
Deploy SendPortal
SendPortal template with PostgreSQL & Redis
Postgres
railwayapp-templates/postgres-ssl:17
Just deployed
/var/lib/postgresql/data
Redis
redis:8.2.1
Just deployed
/data
sendportal
XavTo/sendportal-Selfhost
Just deployed
Deploy and Host SendPortal with Railway
SendPortal is an open‑source, self‑hosted email marketing app (built on Laravel) for creating lists, tags, templates and sending campaigns via your own email provider. It is lightweight, database‑backed, and supports multiple ESPs (Postmark, SES, Mailgun, SendGrid, Mailjet, SMTP).
About Hosting SendPortal
This template provisions a ready‑to‑run container that serves SendPortal (via FrankenPHP/Caddy), a PostgreSQL database for application data, and Redis for queues/caching. Laravel Horizon is enabled to process SendPortal queues (sendportal-message-dispatch
, sendportal-webhook-process
) and the Laravel scheduler runs every minute to progress campaigns and housekeeping tasks. A health endpoint is exposed at /health
for Railway checks.
Common Use Cases
- Self‑host newsletters with your own ESP billing (no per‑subscriber fees).
- Run marketing campaigns and drip sequences using your existing infrastructure.
- Keep data in your own database with team‑member invites and roles.
- Control tracking (opens/clicks) via provider webhooks handled by SendPortal.
Dependencies for SendPortal Hosting
- PostgreSQL: primary application database with persistent storage.
- Redis: queues and cache; required by Horizon.
- Queue workers: Horizon or
queue:work
consumingsendportal-message-dispatch
andsendportal-webhook-process
. - Scheduler:
php artisan schedule:run
executed every minute inside the container. - Email Service Provider (ESP): Postmark, SES, Mailgun, SendGrid, Mailjet, or SMTP account.
- Verified sender domain at the ESP for deliverability and link tracking.
- Application configuration:
APP_URL
,APP_KEY
,APP_ENV
,QUEUE_CONNECTION=redis
, etc. - Health check:
/health
endpoint returningOK
for Railway.
Important: App‑level mail settings (
MAIL_*
) are used only for user management emails (signup, invite, password reset). For campaign emails you must create an Email Service inside the SendPortal UI (left menu → Email Services) and select your ESP (SES, Postmark, Mailgun, SendGrid, Mailjet, SMTP).
Deployment Dependencies
- PostgreSQL
- Redis
One‑click deploy (what happens)
- The container boots, publishes vendor assets, runs DB migrations.
- Horizon is started to process queued jobs via Redis.
- A cron inside the container triggers
php artisan schedule:run
every minute. - The app exposes
/health
returningOK
for Railway health checks.
Environment variables (required / recommended)
The values below are examples. Replace them with your own credentials.
Core app
Variable | Required | Example | Notes |
---|---|---|---|
APP_NAME | ✅ | SendPortal | Display name used in emails/UI. |
APP_ENV | ✅ | production | production recommended. |
APP_KEY | ✅ | (random 32‑char) | Laravel encryption key. Generate once and keep stable. |
APP_URL | ✅ | https://your-app.up.railway.app | Used to build links (unsubscribe, verification, webhooks). |
APP_DEBUG | ⛔ | false | Keep false in production. |
SESSION_DRIVER | ✅ | redis | Matches the bundled Redis. |
CACHE_DRIVER | ✅ | redis | — |
QUEUE_CONNECTION | ✅ | redis | Required for Horizon/queues. |
SESSION_LIFETIME | ➖ | 120 | Minutes. |
APP_TIMEZONE | ➖ | Europe/Paris | Requires config/app.php: 'timezone' => env('APP_TIMEZONE','UTC') . |
Database (PostgreSQL)
Variable | Required | Example |
---|---|---|
DB_CONNECTION | ✅ | pgsql |
DB_HOST | ✅ | Provided by Railway Postgres plugin |
DB_PORT | ✅ | 5432 |
DB_DATABASE | ✅ | Provided by Railway Postgres plugin |
DB_USERNAME | ✅ | Provided by Railway Postgres plugin |
DB_PASSWORD | ✅ | Provided by Railway Postgres plugin |
Redis
Variable | Required | Example |
---|---|---|
REDIS_HOST | ✅ | Provided by Railway Redis plugin |
REDIS_PORT | ✅ | Provided by Railway Redis plugin |
REDIS_PASSWORD | ✅ | Provided by Railway Redis plugin |
Mail (used only for user‑management emails)
Variable | Required | Example | Description |
---|---|---|---|
MAIL_MAILER | ✅ | smtp | App mailer for login/register/reset. Options: smtp , sendmail , ses , mailgun , postmark . |
MAIL_HOST | ✅ (if smtp) | pro2.mail.ovh.net | SMTP server host. |
MAIL_PORT | ✅ (if smtp) | 587 | Typically 587 (TLS), 465 (SSL), or 25 . |
MAIL_USERNAME | ✅ (if smtp) | [email protected] | SMTP username / full email. |
MAIL_PASSWORD | ✅ (if smtp) | your-secure-password | SMTP password. |
MAIL_ENCRYPTION | ➖ | tls | tls , ssl , or null . |
MAIL_FROM_ADDRESS | ✅ | [email protected] | From address for system emails. |
MAIL_FROM_NAME | ✅ | ${APP_NAME} | From name for system emails. |
Provider‑specific (if not using SMTP):
- Postmark: set
MAIL_MAILER=postmark
andPOSTMARK_TOKEN=your-token
- Mailgun: set
MAIL_MAILER=mailgun
and provideMAILGUN_DOMAIN
,MAILGUN_SECRET
, optionalMAILGUN_ENDPOINT
- AWS SES: set
MAIL_MAILER=ses
and provideAWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,AWS_DEFAULT_REGION
SendGrid/Mailjet are available as Email Services inside SendPortal for campaign sending. They do not use the
MAIL_*
envs – configure them in SendPortal → Email Services.
Health check (Railway)
Set the health check path to:
/health
Expected status: 200 OK with body OK
.
How campaigns are dispatched
- You create a campaign, pick recipients (list/tag), and Send / Queue it.
- The job enters
sendportal-message-dispatch
(visible in /horizon). - Horizon workers pull from Redis and send through your Email Service (configured in the UI).
- Webhooks (provider dependent) are handled by jobs in
sendportal-webhook-process
.
If you do not see jobs in Horizon, verify:
QUEUE_CONNECTION=redis
and Redis credentials are correct.- Your Email Service exists and sends a successful test email.
- The scheduler is running (container includes cron to run
schedule:run
each minute).
Why Deploy SendPortal on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you do not have to deal with configuration, while allowing you to vertically and horizontally scale it. By deploying SendPortal on Railway, you are one step closer to supporting a complete full‑stack application with minimal burden. Host your servers, databases, and more on Railway.
Template Content
Redis
redis:8.2.1sendportal
XavTo/sendportal-SelfhostMAIL_HOST
The SMTP server used to send outgoing emails. Example: pro2.mail.ovh.net
MAIL_PORT
The port number used by the SMTP server. Usually 587 for TLS, 465 for SSL, or 25 for plain connections. Example: 587
MAIL_PASSWORD
The password associated with your SMTP username. Make sure this value is stored securely. Example: your-secure-password
MAIL_USERNAME
The username or full email address used to authenticate with your SMTP provider. Example: [email protected]
MAIL_ENCRYPTION
The encryption protocol used for the SMTP connection. Valid values: tls, ssl, or null (no encryption). Example: tls
MAIL_FROM_ADDRESS
The email address that will appear in the "From" field of outgoing emails. Example: [email protected]