RelaySMS Gateway Server is the online router that receives messages from gateway clients and directs them to users' chosen internet platforms.
- Python: ≥ 3.8.10
- Database: MySQL (≥ 8.0.28), MariaDB, or SQLite
- External Services:
- RelaySMS Publisher (required)
- RelaySMS Bridge (required)
- IMAP Email Server (optional, for email monitoring)
Ubuntu Dependencies:
sudo apt install python3-dev libmysqlclient-dev makeQuick install:
curl -fsSL https://raw.githubusercontent.com/smswithoutborders/RelaySMS-Gateway-Server/main/install.sh | sudo bashManage services:
cd /opt/relaysms/relaysms-gateway-server
./manage.sh {start|stop|restart|status|logs|update}See INSTALL.md for manual installation and detailed configuration.
# Setup environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Configure
cp template.env .env
# Edit .env as needed
# Build
make grpc-compile
# Start services (use separate terminals)
python3 -m src.imap_listener # Terminal 1 (optional)
python3 -m src.ftp_server # Terminal 2
make start-rest-api # Terminal 3Quick Development Setup:
./scripts/quick-setup.sh && ./scripts/quick-start.shWarning
Quick setup is for development only. Do not use in production.
docker build -t relaysms-gateway-server:latest .docker run -d \
--name relaysms-gateway-server \
--env-file .env \
-p 5000:5000 -p 5001:5001 \
-p 2222:2222 -p 60000-65000:60000-65000 \
-v $(pwd)/data:/gateway_server/data \
relaysms-gateway-server:latestTip
Update HOST=0.0.0.0 in .env for external container access.
Configure via environment variables, either in your shell or a .env file.
To load from .env:
set -a
source .env
set +aOr set individually:
export HOST=localhost
export PORT=5000
# etc.SSL_SERVER_NAME: SSL certificate server name (default:localhost)HOST: REST server host (default:localhost)PORT: REST server port (default:5000)SSL_PORT: REST SSL port (default:5001)SSL_CERTIFICATE,SSL_KEY,SSL_PEM: SSL file paths (optional)
PUBLISHER_GRPC_HOST: Publisher gRPC server host (default:127.0.0.1)PUBLISHER_GRPC_PORT: Publisher gRPC server port (default:6000)
Important
RelaySMS Publisher must be installed and running. See RelaySMS Publisher Installation
BRIDGE_GRPC_HOST: Bridge gRPC server host (default:127.0.0.1)BRIDGE_GRPC_PORT: Bridge gRPC server port (default:10000)
Important
RelaySMS Bridge must be installed and running. See RelaySMS Bridge Installation
ORIGINS: Allowed CORS origins (default:[])
MYSQL_HOST: MySQL host (default:127.0.0.1)MYSQL_USER: MySQL usernameMYSQL_PASSWORD: MySQL passwordMYSQL_DATABASE: MySQL database (default:relaysms_gateway_server)SQLITE_DATABASE_PATH: SQLite file path (default:data/gateway_server.db)
IMAP_SERVER: IMAP server hostnameIMAP_PORT: IMAP server port (default:993)IMAP_USERNAME: IMAP usernameIMAP_PASSWORD: IMAP passwordMAIL_FOLDER: Mail folder to monitor (default:INBOX)
Note
IMAP configuration is optional. Required only if you want to monitor emails for incoming messages.
Gmail Setup: Enable IMAP in settings and create an App Password at https://myaccount.google.com/apppasswords. See INSTALL.md for details.
FTP_USERNAME: FTP usernameFTP_PASSWORD: FTP passwordFTP_IP_ADDRESS: FTP server IP address (default:localhost)FTP_PORT: FTP server port (default:2222)FTP_PASSIVE_PORTS: FTP passive port range (default:60000-65000)FTP_READ_LIMIT: FTP read limit in bytes (default:51200)FTP_WRITE_LIMIT: FTP write limit in bytes (default:51200)FTP_MAX_CON: Maximum FTP connections (default:256)FTP_MAX_CON_PER_IP: Maximum FTP connections per IP (default:5)FTP_DIRECTORY: FTP directory path (default:data/ftp_file_store)
SMTP_ALLOWED_EMAIL_ADDRESSES: Allowed email addresses for SMTPDISABLE_BRIDGE_PAYLOADS_OVER_HTTP: Disable bridge payloads over HTTP (default:false)
LOG_LEVEL: Logging level (default:info)
- Installation Guide - Detailed setup instructions
- API V3 - REST API documentation
- Gateway Client CLI - CLI documentation
- Fork the repository
- Create a feature branch:
git checkout -b feature-branch - Commit your changes
- Push to your branch
- Open a pull request
Licensed under the GNU General Public License (GPL). See LICENSE for details.