You will find more details about the setup on https://shrtn.io/setup.
- Install Docker: Download from Docker's official website.
- Run the Docker Container:
From Docker Hub:
docker run -d -p 3001:3001 \
--name your-shrtn-container \
-v ./data:/data \
-e ORIGIN=http://localhost:3001 \
-e [email protected] \
cordlesswool/shrtnFrom GitHub Container Registry (ghcr.io):
docker run -d -p 3001:3001 \
--name your-shrtn-container \
-v ./data:/data \
-e ORIGIN=http://localhost:3001 \
-e [email protected] \
ghcr.io/cordlesswool/shrtn- Access the Application: Navigate to
http://localhost:3001.
- Download and Extract: Get the package from the releases page and extract it.
- Install Dependencies and Start:
bun install --production bun run db:migrate node ./index.js
- Access the Application: Navigate to
http://localhost:3001.
To configure the application, set the following environment variables. Default values are provided for convenience.
# Database connection string
DATABASE_URL=file:sqlite_file_name.db
# Base URL for the public-facing site, could also be provided by request headers
ORIGIN=http://localhost:5173
# Using SMTP to send emails
MAIL_PROVIDER=smtp
MAIL_HOST=smtp.example.com
[email protected]
MAIL_PORT=465
[email protected]
MAIL_PASS=secure_password
# Using Mailgun to send emails
MAIL_PROVIDER=mailgun
MAILGUN_API_KEY=your_mailgun_api_key
MAILGUN_DOMAIN=your_mailgun_domain
MAILGUN_URL=https://api.mailgun.net
# Using Mailpit to send emails
MAIL_PROVIDER=mailpit
MAILPIT_DOMAIN=http://localhost:8025
# Time-to-live settings for temporary and user-generated content
## Possible values: HOUR, DAY, WEEK, MONTH, YEAR, EVER
PUBLIC_TTL_TEMP=YEAR # Temporary content expires after 30 days
PUBLIC_TTL_USER=EVER # User-generated content expires after 1 year
With the Version 2 the package switched from better-sqlite3 to libSQL. This means you can now use a higher variety of databases.
In combination with Cloudflare you will now be able to use Cloudflare D1.
In version 2, support for Cloudflare workers was added. There is a wrangler file in the source directory.
Remember to adapt the envs to your needs.