Deploying not-th.re
Introduction
not-th.re is a privacy-focused, minimalist link shortener and pastebin service. Designed with privacy as a core principle, it provides essential URL shortening and text sharing functionality without tracking, analytics, or data mining.
The application offers a clean, distraction-free interface for creating short links and sharing text snippets. With optional end-to-end encryption for pastes, not-th.re ensures that sensitive information remains private even from the server operator.
Key highlights of not-th.re:
- Privacy-First Design: No tracking, analytics, or unnecessary data collection
- Link Shortening: Create short, memorable URLs for long links
- Pastebin Functionality: Share text snippets and code with syntax highlighting
- End-to-End Encryption: Optional client-side encryption for sensitive content
- Custom Short Codes: Choose your own short URL slugs when available
- Expiration Options: Set links and pastes to expire automatically
- API Access: Programmatic access for automation and integrations
- Minimal Dependencies: Lightweight implementation with few requirements
- Self-Hosted: Complete control over your shortening service
- No Registration: Use immediately without creating an account
- Open Source: Transparent codebase you can audit
This guide walks through deploying not-th.re on Klutch.sh using Docker, configuring the service, and using it for link shortening and text sharing.
Why Deploy not-th.re on Klutch.sh
Deploying not-th.re on Klutch.sh provides several advantages:
Privacy Control: Self-hosting means you control the data and can guarantee no third-party tracking.
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds not-th.re without complex configuration.
Persistent Storage: Attach persistent volumes for your database, ensuring links and pastes survive restarts.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, essential for secure link sharing.
GitHub Integration: Connect your configuration repository for automatic redeployments.
Custom Domains: Use your own short domain for branded, professional short links.
Low Resources: The minimal design runs efficiently with small resource allocations.
Prerequisites
Before deploying not-th.re on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) A short custom domain for your links
Understanding not-th.re Architecture
not-th.re uses a simple, efficient architecture:
Web Server: Handles HTTP requests for creating and resolving short links.
Database: Stores link mappings and paste content (SQLite or PostgreSQL).
Client-Side Encryption: JavaScript-based encryption that happens in the browser.
API Layer: REST endpoints for programmatic access.
Preparing Your Repository
Create a GitHub repository with your not-th.re configuration.
Repository Structure
not-th-re-deploy/├── Dockerfile├── config.json└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in your repository root:
FROM node:20-alpine
# Set working directoryWORKDIR /app
# Install dependenciesRUN apk add --no-cache git
# Clone not-th.re repositoryRUN git clone https://github.com/not-th-re/not-th.re.git .
# Install dependenciesRUN npm install --production
# Set environment variablesENV NODE_ENV=productionENV PORT=3000ENV BASE_URL=${BASE_URL}ENV DATABASE_URL=${DATABASE_URL:-sqlite:./data/database.sqlite}
# Create data directoryRUN mkdir -p /app/data
# Copy configurationCOPY config.json /app/config.json
# Expose portEXPOSE 3000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
# Start the applicationCMD ["node", "server.js"]Creating the Configuration File
Create config.json:
{ "server": { "port": 3000, "baseUrl": "${BASE_URL}" }, "database": { "type": "sqlite", "path": "./data/database.sqlite" }, "shortener": { "defaultLength": 6, "allowCustom": true, "reservedSlugs": ["api", "admin", "about", "help"] }, "paste": { "maxSize": 1048576, "defaultExpiry": 604800, "allowEncryption": true }, "rateLimit": { "enabled": true, "windowMs": 60000, "maxRequests": 30 }, "privacy": { "collectAnalytics": false, "logIPs": false, "retentionDays": 0 }}Creating the .dockerignore File
.git.github*.mdLICENSE.gitignore*.log.DS_Store.envnode_modulesEnvironment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
BASE_URL | Yes | - | Public URL of your instance |
DATABASE_URL | No | sqlite:./data/database.sqlite | Database connection string |
PORT | No | 3000 | Server port |
NODE_ENV | No | production | Node environment |
Deploying not-th.re on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
Push Your Repository to GitHub
Initialize and push your repository with the Dockerfile and configuration.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project called “not-th-re” or similar.
Create a New App
Within your project, create a new app and connect your GitHub repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
BASE_URL | https://your-app-name.klutch.sh |
NODE_ENV | production |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/data | 5 GB | Database and stored content |
Deploy Your Application
Click Deploy to start the build process.
Access not-th.re
Once deployment completes, access your instance at https://your-app-name.klutch.sh.
Test Your Service
Create a test short link or paste to verify everything works.
Using not-th.re
Shortening Links
Create a short link through the web interface:
- Enter your long URL in the input field
- Optionally specify a custom short code
- Click to shorten
- Copy and share your new short link
Creating Pastes
Share text snippets:
- Click on “Paste” or navigate to the paste section
- Enter or paste your text content
- Select syntax highlighting (if applicable)
- Choose expiration time
- Enable encryption if needed
- Create and share your paste link
Using Encryption
For sensitive content:
- Toggle encryption option before creating
- Content is encrypted in your browser
- The decryption key is part of the URL fragment
- Server never sees the unencrypted content
API Usage
Programmatically create short links:
curl -X POST https://your-app.klutch.sh/api/shorten \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/very/long/url"}'Create pastes via API:
curl -X POST https://your-app.klutch.sh/api/paste \ -H "Content-Type: application/json" \ -d '{"content": "Your text here", "expiry": 86400}'Custom Domains
Setting Up a Short Domain
For professional short links:
- Register a short domain (e.g., yourbrand.link)
- Configure DNS to point to your Klutch.sh app
- Update
BASE_URLenvironment variable - Redeploy with new configuration
Benefits of Custom Domains
- Brand recognition in shared links
- Professional appearance
- Full control over your namespace
- No dependency on third-party shorteners
Privacy Features
No Analytics
not-th.re doesn’t track:
- Click counts
- User demographics
- Referrer information
- Browser fingerprints
No IP Logging
With logIPs: false, client IP addresses are not stored.
Data Retention
Configure automatic deletion of expired links and pastes.
Client-Side Encryption
For encrypted pastes:
- Encryption happens in the browser using AES-256
- The server only stores encrypted ciphertext
- Decryption key is in the URL fragment (never sent to server)
- Even the server operator cannot read encrypted content
Troubleshooting
Links Not Redirecting
- Verify the database is accessible
- Check that the slug exists
- Review server logs for errors
Encryption Not Working
- Ensure JavaScript is enabled
- Check browser compatibility
- Verify the URL fragment is intact
Database Errors
- Check volume mount permissions
- Verify database path configuration
- Ensure sufficient disk space
Rate Limiting Issues
- Adjust rate limit settings if needed
- Consider disabling for private use
- Check client IP detection
Additional Resources
- not-th.re GitHub Repository
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
- Klutch.sh Custom Domains
Conclusion
Deploying not-th.re on Klutch.sh gives you a privacy-focused link shortener and pastebin that you fully control. With no tracking, optional encryption, and a clean interface, not-th.re provides essential sharing functionality without compromising privacy.
Whether you need a personal URL shortener, a private pastebin for sensitive code, or a branded link service for your organization, not-th.re on Klutch.sh provides a reliable, privacy-respecting solution that runs entirely under your control.