
YOURLS
The de facto standard self-hosted URL shortener.
yourls
yourls:latest
Just deployed
MySQL
mysql:9
Just deployed
Deploy and Host YOURLS on Railway
YOURLS (Your Own URL Shortener) is a free, open-source PHP application that lets you run your own URL shortening service on your server. You'll have full control over your data, detailed analytics, custom short domains, and extensive plugin support - all without depending on third-party services.
Implementation Details
Initial Setup Process:
- After deployment, visit the
yourls
service in Railway - Go to Settings → Networking → Edit Port
- Select the port in the dropdown, or manually enter
80
- Re-deploy the service
Post-Installation Configuration:
- Root domain will show "Forbidden" (this is expected)
- Visit
/admin
to access the installation page - Click "Install YOURLS" and wait for completion
- Default username:
admin
- Password: Found in Variables tab as
YOURLS_PASS
(notYOURLS_DB_PASS
) - Password can be changed in Variables and applied with re-deployment
About Hosting YOURLS
Hosting YOURLS involves deploying a PHP-based web application with a MySQL database backend. The setup includes configuring Apache web server with mod_rewrite, setting up database connections, and managing user authentication. YOURLS provides comprehensive statistics, click tracking, and customizable short URLs using your own domain. The platform supports extensive customization through plugins and themes, making it ideal for businesses, developers, and organizations who want complete control over their URL shortening infrastructure while maintaining branding consistency.
Common Use Cases
- Brand-consistent marketing campaigns - Use your own domain for all shortened links to maintain brand recognition and trust
- Analytics and tracking - Monitor click-through rates, geographic data, and referrer information for marketing insights
- Internal link management - Create memorable short links for internal documentation, resources, and team sharing
- Social media optimization - Generate clean, trackable links for social media posts and email campaigns
- API integration - Programmatically create and manage short URLs through YOURLS' comprehensive REST API
Dependencies for YOURLS Hosting
- PHP 8.1+ with cURL extension enabled for API functionality
- MySQL 5.0+ or MariaDB 10.0+ for data storage and link management
- Apache 2.4+ with mod_rewrite module for URL routing
- HTTPS support recommended for security and modern browser compatibility
Deployment Dependencies
- YOURLS Official Documentation - Complete installation and configuration guide
- YOURLS GitHub Repository - Source code and issue tracking
- Awesome YOURLS - Community plugins, themes, and tools
Why Deploy YOURLS 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 YOURLS 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
yourls
yourls:latestMySQL
mysql:9