Skip to content

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in your repository root:

FROM node:20-alpine
# Set working directory
WORKDIR /app
# Install dependencies
RUN apk add --no-cache git
# Clone not-th.re repository
RUN git clone https://github.com/not-th-re/not-th.re.git .
# Install dependencies
RUN npm install --production
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
ENV BASE_URL=${BASE_URL}
ENV DATABASE_URL=${DATABASE_URL:-sqlite:./data/database.sqlite}
# Create data directory
RUN mkdir -p /app/data
# Copy configuration
COPY config.json /app/config.json
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
# Start the application
CMD ["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
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
node_modules

Environment Variables Reference

VariableRequiredDefaultDescription
BASE_URLYes-Public URL of your instance
DATABASE_URLNosqlite:./data/database.sqliteDatabase connection string
PORTNo3000Server port
NODE_ENVNoproductionNode environment

Deploying not-th.re on Klutch.sh

    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:

    • Select HTTP as the traffic type
    • Set the internal port to 3000

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    BASE_URLhttps://your-app-name.klutch.sh
    NODE_ENVproduction

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /app/data5 GBDatabase 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

Create a short link through the web interface:

  1. Enter your long URL in the input field
  2. Optionally specify a custom short code
  3. Click to shorten
  4. Copy and share your new short link

Creating Pastes

Share text snippets:

  1. Click on “Paste” or navigate to the paste section
  2. Enter or paste your text content
  3. Select syntax highlighting (if applicable)
  4. Choose expiration time
  5. Enable encryption if needed
  6. Create and share your paste link

Using Encryption

For sensitive content:

  1. Toggle encryption option before creating
  2. Content is encrypted in your browser
  3. The decryption key is part of the URL fragment
  4. Server never sees the unencrypted content

API Usage

Programmatically create short links:

Terminal window
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:

Terminal window
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:

  1. Register a short domain (e.g., yourbrand.link)
  2. Configure DNS to point to your Klutch.sh app
  3. Update BASE_URL environment variable
  4. 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

  • 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

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.