Deploy FalkorDB on Railway
Railway is a modern platform-as-a-service (PaaS) that makes it easy to deploy and manage applications. FalkorDB provides verified templates on Railway for quick deployment, enabling you to get started with a graph database in minutes without managing infrastructure.
Available Templates
FalkorDB offers two verified deployment templates on Railway:
- Single Instance - A standalone FalkorDB instance, ideal for development, testing, and small production workloads
- Cluster - A multi-node FalkorDB cluster for high availability and horizontal scalability
Prerequisites
Before deploying FalkorDB on Railway, ensure you have:
- A Railway account (free tier available)
- Basic understanding of FalkorDB and graph databases
Option 1: Single Instance Deployment
The single instance template deploys a standalone FalkorDB server with the browser interface enabled by default.
Deploy the Template
- Visit the FalkorDB Single Instance template
- Click the Deploy button
- Sign in to your Railway account or create one if needed
- Railway will automatically provision and deploy your FalkorDB instance
- Once deployment completes, you’ll receive connection details
Accessing Your Instance
After deployment, you can access your FalkorDB instance:
Using the Browser Interface
- Navigate to your Railway project dashboard
- Click on the FalkorDB service
-
Then click on the public domain to open the browser
- Find the FALKORDB_PASSWORD in the service variables settings
- Use the FALKORDB_PASSWORD in your browser to login to your database
Defaults are:
- Host: falkordb.railway.internal
- Port: 16379
- Username: default
Connecting via Client
To connect from your application or command line:
Locate the FALKORDB_PRIVATE_URL or the FALKORDB_PUBLIC_URL:
Connect using redis-cli:
redis-cli -u <FALKORDB_PUBLIC_URL>
Option 2: Cluster Deployment
The cluster template deploys a multi-node FalkorDB cluster for production workloads requiring high availability and horizontal scalability.
Deploy the Template
- Visit the FalkorDB Cluster template
- Click the Deploy button
- Sign in to your Railway account
- Railway will provision multiple FalkorDB nodes and configure them as a cluster
- Wait for all nodes to be deployed and the cluster to be initialized
Cluster Architecture
The FalkorDB cluster template typically includes:
- Multiple master nodes - Distribute data across shards
- Replica nodes - Provide redundancy and failover capabilities
- High availability - Continues operating even if individual nodes fail
Connecting to the Cluster
To connect to your FalkorDB cluster:
- Get the cluster endpoint from your Railway project dashboard
- Use FalkorDB cluster-aware clients for optimal performance
Example with Python:
from falkordb import FalkorDB
# Create connection with cluster support
db = FalkorDB(
host='<your-railway-cluster-host>',
port=6379,
password='<your-password>'
)
# Select a graph
g = db.select_graph('mygraph')
# Execute queries as normal
result = g.query("CREATE (n:Person {name: 'Bob', age: 25})")
result = g.query("MATCH (n:Person) RETURN n.name, n.age")
Using redis-cli with cluster mode:
export REDISCLI_AUTH="<your-password>"
redis-cli -c -h <your-railway-cluster-host> -p 6379
Best Practices
Data Persistence
The template provides persistent volumes for data storage:
- Data persists across deployments and restarts
- Regular backups are recommended for production workloads
- Consider implementing your own backup strategy for critical data
Monitoring and Logs
Railway provides built-in monitoring and logging:
- Navigate to your FalkorDB service in the Railway dashboard
- View real-time logs in the Logs tab
- Monitor metrics in the Metrics tab
- Set up alerts for service health and resource usage