Features
Dubly packs powerful URL shortening capabilities into a simple, self-hosted package. Here’s everything you can do with it.Link management
Custom slugs
Choose your own memorable short URLs or let Dubly generate random 6-character slugs
Multi-domain support
Configure multiple custom domains and choose which one to use for each link
Bulk operations
List, search, and filter links with pagination support via the API
Soft deletes
Deleted links return HTTP 410 Gone instead of 404, preserving link history
Link metadata
Every link can include:- Title - A human-readable name for the link
- Tags - Organize links with comma-separated tags
- Notes - Internal notes for documentation
- Destination - The target URL (can be updated at any time)
Automatic slug generation
When you don’t provide a custom slug, Dubly generates a cryptographically random 6-character Base62 string usingcrypto/rand. The system automatically retries up to 10 times if a collision occurs.
Analytics and tracking
Click tracking
Every click is recorded with timestamp, IP, user agent, and referrer information
Geographic data
Optional GeoIP integration tracks country, city, region, and coordinates
Device insights
Automatically parse browser, OS, and device type from user agents
Referrer tracking
See where your traffic comes from with full referrer domain extraction
Analytics metrics
Dubly tracks comprehensive metrics for each link:- Total clicks - All-time click count
- Today’s clicks - Clicks from the current day
- 7-day trends - Current week vs. previous week comparison
- Top referrers - Most common traffic sources
- Geographic breakdown - Clicks by country
- Browser distribution - Browser and version information
- Device types - Desktop, mobile, tablet, etc.
Performance optimization
Analytics are buffered in memory and flushed to SQLite in batches. The default configuration:- Buffer size: 50,000 events
- Flush interval: 30 seconds
- Non-blocking: Drops events when buffer is full instead of blocking redirects
Bot and traffic filtering
User-Agent detection
Filter out known bot signatures including preview fetchers and crawlers
IP-based filtering
Block datacenter IPs, Tor exit nodes, and threat intelligence feeds
User-Agent filtering
Dubly automatically filters requests from:- Link preview fetchers: iMessage, Discord, Slack, WhatsApp, Facebook, Twitter, LinkedIn, Telegram
- Search engine crawlers: Google, Bing, and other search bots
- HTTP clients: curl, wget, python-requests, ruby, java, okhttp
- Headless browsers: PhantomJS, Puppeteer, Selenium
- Security scanners: Various penetration testing and scanning tools
IP-based filtering
The datacenter checker fetches and refreshes IP blocklists every 24 hours from:- Datacenter ranges: AWS, GCP, Azure, DigitalOcean, Vultr, Oracle Cloud, Akamai, Scaleway
- Tor exit nodes: Updated list from torproject.org
- Threat intelligence: IPsum and GreenSnow blocklists
QR code generation
Dynamic generation
Generate QR codes on-demand for any link via the admin UI
Customization
Choose between square or circle shapes and set custom foreground colors
QR code options
Customize generated QR codes with URL parameters:- Shape:
squareorcircle - Foreground color: Any hex color (e.g.,
#FF5733) - Download: Add
dl=1to trigger file download - Format: PNG with transparent background
Performance features
LRU cache
Frequently accessed links are cached in memory with configurable size (default: 10,000)
SQLite WAL mode
Write-Ahead Logging enables concurrent reads during writes
Indexed queries
Database indexes on domain, slug, link_id, and clicked_at for fast lookups
Batch inserts
Analytics use transaction-based batch inserts for efficient writes
Cache behavior
- Cache invalidation: Automatic on link update or delete
- Key format:
domain/slugfor unique cache entries - Eviction policy: LRU (Least Recently Used)
- Miss handling: Database query with automatic cache population
RESTful API
Simple authentication
Single API key via X-API-Key header for all endpoints
JSON responses
Clean, consistent JSON for all API responses
CRUD operations
Full create, read, update, delete support for links
Search and pagination
Query links with search terms, limit, and offset parameters
API capabilities
- Create links: POST with custom or auto-generated slugs
- List links: GET with pagination, search, and filtering
- Get single link: Fetch by ID with full metadata
- Update links: PATCH to modify destination, title, tags, or notes
- Delete links: Soft delete that returns 410 Gone on redirect
X-API-Key header for authentication.
Admin dashboard
The built-in web interface provides:- Link management: Create, edit, and delete links without API calls
- Analytics views: Per-link and global analytics dashboards
- QR code generation: Download QR codes with customization options
- Search and filtering: Find links quickly by slug, destination, title, or tags
- Session-based auth: Secure login with password protection
/admin/ on your Dubly instance.
Deployment features
One-line install
Automated script handles Go, Caddy, systemd, and firewall configuration
Automatic HTTPS
Caddy provides automatic SSL certificate management
Graceful shutdown
Waits for in-flight requests and flushes analytics before stopping
Update script
Built-in update mechanism with
--update flagProduction ready
Dubly includes everything needed for production deployment:- Systemd service: Auto-restart on failure
- Firewall rules: UFW configuration for secure access
- Domain management: Add new domains with the
add-domain.shscript - Optional S3 backups: Configure automated database backups to S3
- GeoIP support: Optional MaxMind GeoLite2 integration
Configuration flexibility
All settings are managed via environment variables:- Required: Password, allowed domains
- Optional: Port, database path, GeoIP path, buffer sizes, cache size, app name
- Defaults: Sensible production defaults for all optional settings