Deploying Shaarli
Introduction
Shaarli is a minimalist, database-free bookmark manager and link sharing platform. Often described as “your own personal, federated, Twitter-like platform,” Shaarli lets you save bookmarks, write notes, and share content through a simple web interface. Its file-based storage approach means no database setup is required, making it incredibly easy to deploy and maintain.
Built with PHP, Shaarli has been in active development since 2011 and has earned a devoted following among self-hosters who appreciate its simplicity and reliability. The application supports tags, full-text search, RSS feeds, and even a bookmarklet for quick saving from any webpage.
Key highlights of Shaarli:
- No Database Required: Stores data in flat files for simplicity
- Tag System: Organize links with flexible tagging
- Full-Text Search: Fast search across all your links
- RSS/Atom Feeds: Subscribe to your links or specific tags
- Private/Public Links: Choose what to share publicly
- Bookmarklet: Save links with one click from any page
- Daily Digest: Automatically generated daily link collections
- API: REST API for integrations and custom clients
- Plugins: Extend functionality with plugins
- 100% Open Source: Licensed under Zlib
This guide walks through deploying Shaarli on Klutch.sh using Docker, configuring your link collection, and setting up efficient bookmark management.
Why Deploy Shaarli on Klutch.sh
Deploying Shaarli on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles PHP configuration automatically with no database setup needed.
Persistent Storage: Attach persistent volumes for your bookmark data that survives restarts.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure access.
Lightweight: Minimal resource requirements due to file-based storage.
Custom Domains: Use your own domain for a personalized link sharing site.
Prerequisites
Before deploying Shaarli on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Shaarli configuration
- Basic familiarity with Docker and containerization concepts
Preparing Your Repository
Create a GitHub repository with your Shaarli configuration.
Repository Structure
shaarli-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM ghcr.io/shaarli/shaarli:latest
# Environment variablesENV SHAARLI_TITLE=${SHAARLI_TITLE:-My Shaarli}ENV SHAARLI_TIMEZONE=${SHAARLI_TIMEZONE:-UTC}
# Create data directoryRUN mkdir -p /var/www/shaarli/data
# Expose the web interface portEXPOSE 80Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
SHAARLI_TITLE | No | My Shaarli | Title displayed on your Shaarli instance |
SHAARLI_TIMEZONE | No | UTC | Timezone for timestamps |
Deploying Shaarli on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
- Create your admin username and password
- Configure basic settings
- Start adding links
Push Your Repository to GitHub
Initialize and push your repository:
git initgit add Dockerfile .dockerignoregit commit -m "Initial Shaarli deployment configuration"git remote add origin https://github.com/yourusername/shaarli-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “shaarli” or “links”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your Shaarli repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add optional environment variables:
| Variable | Value |
|---|---|
SHAARLI_TITLE | Your custom title |
SHAARLI_TIMEZONE | Your timezone |
Attach Persistent Volumes
Add the following volume:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/shaarli/data | 5 GB | Link database, cache, and configuration |
Deploy Your Application
Click Deploy to start the build process.
Complete Installation
Access your Shaarli instance at https://your-app-name.klutch.sh and complete the setup:
Using Shaarli
Adding Links
- Click Shaare in the menu
- Enter the URL
- Add a title and description
- Add tags (space or comma separated)
- Choose public or private
- Click Save
Using the Bookmarklet
- Go to Tools in the menu
- Drag the bookmarklet to your bookmarks bar
- On any page, click the bookmarklet to save it to Shaarli
Organizing with Tags
- Add tags when creating links
- Click tags in the tag cloud to filter
- Use tag operators:
tag1 tag2- links with both tagstag1+tag2- links with either tag-tag1- exclude tag
Search
Use the search box to find links by:
- Title
- Description
- URL
- Tags
RSS Feeds
Shaarli generates RSS feeds automatically:
- All public links:
/feed/atom - By tag:
/feed/atom?searchtags=tagname - Daily:
/daily
Configuration Options
Privacy Settings
- Go to Tools > Configure your Shaarli
- Set default visibility (public/private)
- Configure API access
- Enable/disable features
Themes
- Go to Tools > Configure your Shaarli
- Select a theme from the dropdown
- Custom themes can be added to the
tpl/directory
Plugins
Enable plugins in Tools > Configure your Shaarli:
- Archive.org: Add Wayback Machine links
- Default Colors: Customize link colors
- Markdown: Format descriptions with Markdown
- Playvideos: Inline video playback
- QRcode: Generate QR codes for links
Troubleshooting
Cannot Log In
Symptoms: Login fails or page redirects.
Solutions:
- Clear browser cookies for the site
- Check that the data volume is mounted
- Verify the installation completed properly
Links Not Saving
Symptoms: Added links disappear.
Solutions:
- Verify persistent volume is mounted at
/var/www/shaarli/data - Check file permissions in the data directory
- Review PHP error logs
Search Not Working
Symptoms: Search returns no results.
Solutions:
- Rebuild the search index in Tools
- Check that links are public (if not logged in)
- Verify the data files aren’t corrupted
Additional Resources
Conclusion
Deploying Shaarli on Klutch.sh gives you a lightweight, reliable bookmark manager that requires no database and minimal resources. With its tag system, RSS feeds, and bookmarklet, Shaarli provides everything needed to build your personal link collection while keeping full control of your data.