Skip to content

Deploying Cryptgeon

Introduction

Cryptgeon is a powerful open-source secure note sharing platform that enables users to share sensitive information with end-to-end encryption and automatic expiration. Built with security and privacy in mind, Cryptgeon ensures that shared notes are encrypted client-side and can only be accessed once before being automatically destroyed. This makes it an ideal solution for sharing passwords, confidential messages, API keys, and other sensitive data.

Deploying Cryptgeon on Klutch.sh provides a scalable, production-ready infrastructure with Docker support, persistent storage capabilities, and seamless GitHub integration. This comprehensive guide walks you through every step of deploying Cryptgeon using a Dockerfile, from initial setup to production best practices.

Key benefits of deploying Cryptgeon on Klutch.sh:

  • Automatic Docker detection and deployment
  • Built-in persistent volume support for data retention
  • Secure environment variable management
  • Simple GitHub-based deployment workflow
  • Automatic HTTPS with custom domains
  • Scalable infrastructure with minimal configuration

What is Cryptgeon?

Cryptgeon is a secure, self-destructing message sharing application that emphasizes privacy and security. Key features include:

Before you begin deploying Cryptgeon, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Cryptgeon deployment
  • Basic familiarity with Docker and containerization concepts
  • Understanding of secure note sharing and encryption principles

Project Structure

For a successful Cryptgeon deployment, your repository should be organized with the following structure:

cryptgeon-deployment/
├─ Dockerfile
├─ README.md
└─ .gitignore

This minimal structure allows Klutch.sh to automatically detect and build your Cryptgeon container.


Getting Started: Installation and Setup

Step 1: Create Your Cryptgeon Repository

    1. Create a new repository on GitHub for your Cryptgeon deployment

    2. Clone the repository to your local machine:

      Terminal window
      git clone https://github.com/yourusername/cryptgeon-deployment.git
      cd cryptgeon-deployment
    3. Initialize your project structure as shown above

Step 2: Create the Dockerfile

Cryptgeon is available as an official Docker image. Create a Dockerfile in your repository root with the following content:

# Use the official Cryptgeon image
FROM cryptgeon/cryptgeon:latest
# Cryptgeon listens on port 5000 by default
EXPOSE 5000
# The official image already has the correct entrypoint configured
# No additional CMD needed

This Dockerfile uses the official Cryptgeon image which includes all necessary dependencies and configurations.

For custom configurations, you can extend the Dockerfile:

FROM cryptgeon/cryptgeon:latest
# Set custom environment variables (optional)
ENV SIZE_LIMIT=4096
ENV VERBOSITY=info
ENV MAX_VIEWS=100
ENV MAX_EXPIRATION=360
# Expose the application port
EXPOSE 5000

Step 3: Understanding Cryptgeon Configuration

Cryptgeon can be configured using environment variables. Key configuration options include:

  • SIZE_LIMIT - Maximum note size in kilobytes (default: 4096)
  • VERBOSITY - Logging level: error, warn, info, debug, trace (default: warn)
  • MAX_VIEWS - Maximum number of views before deletion (default: 100)
  • MAX_EXPIRATION - Maximum expiration time in minutes (default: 360)

These can be set in Klutch.sh’s environment variables configuration, which we’ll cover in the deployment steps.

Step 4: Commit and Push to GitHub

Terminal window
git add Dockerfile README.md
git commit -m "Initial Cryptgeon deployment configuration"
git push origin main

Deploying to Klutch.sh

Now that your repository is prepared, follow these detailed steps to deploy Cryptgeon on Klutch.sh:

Step 1: Access the Klutch.sh Dashboard

    1. Navigate to Klutch.sh Dashboard
    2. Sign in to your account

Step 2: Create a New Project

    1. Click on “Create Project” in the dashboard
    2. Enter a descriptive name for your project (e.g., “Cryptgeon Production”)
    3. Click “Create” to initialize the project

Step 3: Create and Configure Your Application

    1. Within your project, click “Create App”
    2. Select your GitHub repository containing the Cryptgeon Dockerfile
    3. Choose the branch you want to deploy (typically main or master)
    4. Configure Traffic Type:
      • Select HTTP as the traffic type (Cryptgeon is a web application)
    5. Set Internal Port:
      • Set the internal port to 5000 (Cryptgeon’s default listening port)
    6. Select Region and Compute:
      • Choose your preferred deployment region
      • Select appropriate compute resources based on expected traffic
      • For production use, consider at least 512MB RAM
    7. Configure Instance Count:
      • Start with 1 instance for development
      • Scale to multiple instances for production high-availability

Important: Klutch.sh automatically detects the Dockerfile in your repository root and uses it for deployment. You don’t need to specify Docker as a deployment option in the UI - it’s handled automatically.

Step 4: Configure Environment Variables

    1. In the app configuration, navigate to the Environment Variables section

    2. Add the following optional variables to customize Cryptgeon:

      SIZE_LIMIT=4096
      VERBOSITY=info
      MAX_VIEWS=100
      MAX_EXPIRATION=360
    3. Mark any sensitive values as secrets to prevent them from appearing in logs

Step 5: Set Up Persistent Storage

Cryptgeon may store temporary data that you want to persist across deployments. To attach a persistent volume:

    1. In the app configuration, navigate to the Volumes section
    2. Click “Add Volume”
    3. Enter the mount path: /data
    4. Specify the volume size (e.g., 1GB for development, 5GB or more for production)
    5. Click “Create” to attach the volume

Note: You only need to specify the mount path and size. Klutch.sh handles volume naming automatically.

This ensures that any cached data or temporary files persist between deployments and container restarts.

Step 6: Deploy Your Application

    1. Review all configuration settings
    2. Click “Create” or “Deploy” to start the deployment process
    3. Klutch.sh will:
      • Pull your repository from GitHub
      • Detect the Dockerfile automatically
      • Build the Docker image
      • Deploy the container to your chosen region
      • Assign a public URL

Step 7: Access Your Cryptgeon Instance

Once deployment is complete (typically 2-5 minutes):

    1. Your Cryptgeon instance will be available at a URL like example-app.klutch.sh
    2. Visit the URL to access your secure note sharing platform
    3. Test the functionality by creating and sharing a note

Environment Variables Reference

Configure these environment variables in Klutch.sh to customize your Cryptgeon deployment:

VariableDescriptionDefaultExample
SIZE_LIMITMaximum note size in KB40964096
VERBOSITYLog levelwarninfo
MAX_VIEWSMax views before deletion100100
MAX_EXPIRATIONMax expiration time (minutes)360360

Setting environment variables in Klutch.sh:

  1. Navigate to your app in the dashboard
  2. Go to Settings → Environment Variables
  3. Add each variable with its corresponding value
  4. Mark sensitive values as “Secret” to prevent logging
  5. Save changes and redeploy if necessary

Persistent Storage Configuration

Cryptgeon benefits from persistent storage for temporary file handling. Here’s how to configure volumes effectively:

Volume Configuration Best Practices

Mount Path: /data Recommended Sizes:

  • Development: 1GB
  • Production (low traffic): 5GB
  • Production (high traffic): 10GB or more

Setting Up Volumes in Klutch.sh

    1. During app creation or in app settings, navigate to the Volumes section
    2. Add a new volume with:
      • Mount Path: /data
      • Size: Choose based on your traffic expectations
    3. The volume will be automatically attached to your container
    4. Data persists across deployments and restarts

Important considerations:

  • Volumes persist data across deployments
  • Increase volume size as your usage grows
  • Monitor volume usage in the Klutch.sh dashboard
  • Backup important data separately from volumes

Custom Domain Configuration

To use a custom domain with your Cryptgeon deployment:

    1. Navigate to your app settings in the Klutch.sh dashboard
    2. Go to the Domains section
    3. Click “Add Custom Domain”
    4. Enter your domain (e.g., notes.yourdomain.com)
    5. Configure your DNS provider:
      • Add a CNAME record pointing to your Klutch.sh app URL
      • Or add an A record with the provided IP address
    6. Wait for DNS propagation (typically 5-30 minutes)
    7. Klutch.sh automatically provisions and manages SSL/TLS certificates

Your Cryptgeon instance will then be accessible at your custom domain with automatic HTTPS.

For detailed DNS configuration instructions, see the Custom Domains documentation.


Advanced Docker Configuration

Multi-Stage Build for Optimized Images

If you want to customize Cryptgeon or reduce image size, consider a multi-stage Dockerfile:

# Build stage
FROM rust:1.70 as builder
WORKDIR /app
# Clone and build Cryptgeon from source
RUN git clone https://github.com/cupcakearmy/cryptgeon.git .
RUN cargo build --release
# Runtime stage
FROM debian:bullseye-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy binary from builder
COPY --from=builder /app/target/release/cryptgeon /usr/local/bin/
# Expose port
EXPOSE 5000
# Run the application
CMD ["cryptgeon"]

This approach builds Cryptgeon from source and creates a smaller final image.

Custom Entrypoint Script

For advanced initialization, create a custom entrypoint:

FROM cryptgeon/cryptgeon:latest
# Copy custom entrypoint
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 5000
ENTRYPOINT ["docker-entrypoint.sh"]

And create docker-entrypoint.sh:

#!/bin/bash
set -e
# Custom initialization logic here
echo "Starting Cryptgeon with custom configuration..."
# Check if volume is mounted
if [ -d "/data" ]; then
echo "Data volume detected at /data"
fi
# Start Cryptgeon
exec cryptgeon

Security Best Practices

When deploying Cryptgeon in production, follow these security guidelines:

1. Use HTTPS Only

  • Always use custom domains with automatic HTTPS
  • Never serve Cryptgeon over plain HTTP in production
  • Klutch.sh provides automatic SSL/TLS certificate management

2. Secure Environment Variables

  • Store all configuration in Klutch.sh environment variables
  • Mark sensitive values as “Secret” in the dashboard
  • Never commit secrets to your repository
  • Rotate credentials regularly

3. Network Security

  • Cryptgeon handles encryption client-side
  • No additional network configuration required for encryption
  • Use Klutch.sh’s built-in DDoS protection
  • Consider implementing rate limiting for high-traffic deployments

4. Access Control

  • Implement authentication if exposing to limited user base
  • Use firewall rules or IP whitelisting for internal deployments
  • Monitor access logs for suspicious activity

5. Regular Updates

  • Keep Cryptgeon up to date by updating the image tag in your Dockerfile
  • Subscribe to Cryptgeon’s GitHub releases
  • Test updates in a staging environment before production

6. Data Protection

  • Regularly back up persistent volumes
  • Implement disaster recovery procedures
  • Test restoration processes periodically

Monitoring and Scaling

Performance Monitoring

Monitor your Cryptgeon deployment using Klutch.sh’s built-in monitoring:

  1. CPU Usage: Track container CPU utilization
  2. Memory Usage: Monitor RAM consumption
  3. Network Traffic: Observe incoming/outgoing data
  4. Response Times: Check application latency

Access monitoring data in your app’s dashboard under the Monitoring section.

Scaling Strategies

Vertical Scaling:

  • Increase compute resources for single instance
  • Recommended for moderate traffic increases
  • Adjust in app settings → Compute Resources

Horizontal Scaling:

  • Deploy multiple instances behind load balancer
  • Recommended for high-availability production deployments
  • Increase instance count in app settings

Auto-Scaling Considerations:

  • Cryptgeon is stateless by design (notes encrypted client-side)
  • Perfect candidate for horizontal scaling
  • No session affinity required
  • Scale instances based on CPU/memory metrics

Troubleshooting Common Issues

Issue: Application Not Starting

Symptoms: Container starts but app is not accessible

Solutions:

  1. Verify the internal port is set to 5000
  2. Check container logs in Klutch.sh dashboard
  3. Ensure Dockerfile EXPOSE matches internal port configuration
  4. Verify environment variables are properly set

Issue: Persistent Data Not Saving

Symptoms: Data lost after redeployment

Solutions:

  1. Confirm volume is attached with correct mount path (/data)
  2. Check volume size has sufficient space
  3. Verify write permissions in the container
  4. Review application logs for storage errors

Issue: Slow Performance

Symptoms: High latency or timeout errors

Solutions:

  1. Increase compute resources (CPU/RAM)
  2. Check volume I/O performance
  3. Monitor application logs for bottlenecks
  4. Consider scaling to multiple instances
  5. Optimize Dockerfile for faster builds

Issue: Connection Refused

Symptoms: Cannot access the application URL

Solutions:

  1. Verify traffic type is set to HTTP
  2. Confirm internal port matches Cryptgeon’s listening port (5000)
  3. Check deployment status in dashboard
  4. Review container logs for startup errors
  5. Ensure no firewall blocking access

Debugging Commands

Access your container logs:

  1. Navigate to your app in Klutch.sh dashboard
  2. Go to Logs section
  3. View real-time logs for debugging

Production Deployment Checklist

Before deploying Cryptgeon to production, verify:

  • Dockerfile is optimized and tested
  • Custom domain configured with HTTPS
  • Persistent volume attached with adequate size
  • Environment variables properly configured
  • Secrets marked as sensitive in dashboard
  • Monitoring enabled and alerts configured
  • Backup strategy implemented
  • Multiple instances configured for high availability
  • Performance testing completed
  • Security best practices applied
  • Documentation updated with deployment details

Example: Complete Deployment Workflow

Here’s a complete end-to-end workflow for deploying Cryptgeon:

Terminal window
# 1. Create and initialize repository
mkdir cryptgeon-production
cd cryptgeon-production
git init
# 2. Create Dockerfile
cat > Dockerfile << 'EOF'
FROM cryptgeon/cryptgeon:latest
EXPOSE 5000
EOF
# 3. Create README
cat > README.md << 'EOF'
# Cryptgeon Deployment
Production deployment of Cryptgeon on Klutch.sh.
## Configuration
- Port: 5000
- Volume: /data
- Environment variables configured in Klutch.sh dashboard
EOF
# 4. Commit and push
git add .
git commit -m "Initial Cryptgeon deployment"
git remote add origin https://github.com/yourusername/cryptgeon-production.git
git push -u origin main

Then follow the deployment steps in the Klutch.sh dashboard as outlined above.


Updating Your Deployment

To update your Cryptgeon instance:

    1. Update the image tag in your Dockerfile (e.g., FROM cryptgeon/cryptgeon:v2.0.0)
    2. Commit and push changes to GitHub
    3. In Klutch.sh dashboard, navigate to your app
    4. Click “Redeploy” or trigger automatic deployment via GitHub integration
    5. Monitor the deployment progress
    6. Verify the new version is running correctly

Resources and Further Reading


Conclusion

Deploying Cryptgeon on Klutch.sh provides a robust, secure, and scalable solution for sharing sensitive information. With automatic Docker detection, persistent storage support, and seamless GitHub integration, Klutch.sh simplifies the deployment process while maintaining production-grade reliability.

This guide covered everything from initial setup to production best practices, including custom domains, security configurations, monitoring, and troubleshooting. By following these steps, you now have a fully functional Cryptgeon instance ready to securely share encrypted notes with end-to-end encryption.

For additional support or advanced configurations, refer to the resources above or reach out to the Klutch.sh community.