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└─ .gitignoreThis minimal structure allows Klutch.sh to automatically detect and build your Cryptgeon container.
Getting Started: Installation and Setup
Step 1: Create Your Cryptgeon Repository
-
Create a new repository on GitHub for your Cryptgeon deployment
-
Clone the repository to your local machine:
Terminal window git clone https://github.com/yourusername/cryptgeon-deployment.gitcd cryptgeon-deployment -
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 imageFROM cryptgeon/cryptgeon:latest
# Cryptgeon listens on port 5000 by defaultEXPOSE 5000
# The official image already has the correct entrypoint configured# No additional CMD neededThis 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=4096ENV VERBOSITY=infoENV MAX_VIEWS=100ENV MAX_EXPIRATION=360
# Expose the application portEXPOSE 5000Step 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
git add Dockerfile README.mdgit commit -m "Initial Cryptgeon deployment configuration"git push origin mainDeploying 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
- Navigate to Klutch.sh Dashboard
- Sign in to your account
Step 2: Create a New Project
- Click on “Create Project” in the dashboard
- Enter a descriptive name for your project (e.g., “Cryptgeon Production”)
- Click “Create” to initialize the project
Step 3: Create and Configure Your Application
- Within your project, click “Create App”
- Select your GitHub repository containing the Cryptgeon Dockerfile
- Choose the branch you want to deploy (typically
mainormaster) - Configure Traffic Type:
- Select HTTP as the traffic type (Cryptgeon is a web application)
- Set Internal Port:
- Set the internal port to 5000 (Cryptgeon’s default listening port)
- 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
- 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
-
In the app configuration, navigate to the Environment Variables section
-
Add the following optional variables to customize Cryptgeon:
SIZE_LIMIT=4096VERBOSITY=infoMAX_VIEWS=100MAX_EXPIRATION=360 -
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:
- In the app configuration, navigate to the Volumes section
- Click “Add Volume”
- Enter the mount path:
/data - Specify the volume size (e.g.,
1GBfor development,5GBor more for production) - 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
- Review all configuration settings
- Click “Create” or “Deploy” to start the deployment process
- 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):
- Your Cryptgeon instance will be available at a URL like
example-app.klutch.sh - Visit the URL to access your secure note sharing platform
- Test the functionality by creating and sharing a note
Environment Variables Reference
Configure these environment variables in Klutch.sh to customize your Cryptgeon deployment:
| Variable | Description | Default | Example |
|---|---|---|---|
SIZE_LIMIT | Maximum note size in KB | 4096 | 4096 |
VERBOSITY | Log level | warn | info |
MAX_VIEWS | Max views before deletion | 100 | 100 |
MAX_EXPIRATION | Max expiration time (minutes) | 360 | 360 |
Setting environment variables in Klutch.sh:
- Navigate to your app in the dashboard
- Go to Settings → Environment Variables
- Add each variable with its corresponding value
- Mark sensitive values as “Secret” to prevent logging
- 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
- During app creation or in app settings, navigate to the Volumes section
- Add a new volume with:
- Mount Path:
/data - Size: Choose based on your traffic expectations
- Mount Path:
- The volume will be automatically attached to your container
- 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:
- Navigate to your app settings in the Klutch.sh dashboard
- Go to the Domains section
- Click “Add Custom Domain”
- Enter your domain (e.g.,
notes.yourdomain.com) - 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
- Wait for DNS propagation (typically 5-30 minutes)
- 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 stageFROM rust:1.70 as builder
WORKDIR /app
# Clone and build Cryptgeon from sourceRUN git clone https://github.com/cupcakearmy/cryptgeon.git .RUN cargo build --release
# Runtime stageFROM debian:bullseye-slim
# Install runtime dependenciesRUN apt-get update && apt-get install -y \ ca-certificates \ && rm -rf /var/lib/apt/lists/*
# Copy binary from builderCOPY --from=builder /app/target/release/cryptgeon /usr/local/bin/
# Expose portEXPOSE 5000
# Run the applicationCMD ["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 entrypointCOPY 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/bashset -e
# Custom initialization logic hereecho "Starting Cryptgeon with custom configuration..."
# Check if volume is mountedif [ -d "/data" ]; then echo "Data volume detected at /data"fi
# Start Cryptgeonexec cryptgeonSecurity 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:
- CPU Usage: Track container CPU utilization
- Memory Usage: Monitor RAM consumption
- Network Traffic: Observe incoming/outgoing data
- 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:
- Verify the internal port is set to 5000
- Check container logs in Klutch.sh dashboard
- Ensure Dockerfile EXPOSE matches internal port configuration
- Verify environment variables are properly set
Issue: Persistent Data Not Saving
Symptoms: Data lost after redeployment
Solutions:
- Confirm volume is attached with correct mount path (
/data) - Check volume size has sufficient space
- Verify write permissions in the container
- Review application logs for storage errors
Issue: Slow Performance
Symptoms: High latency or timeout errors
Solutions:
- Increase compute resources (CPU/RAM)
- Check volume I/O performance
- Monitor application logs for bottlenecks
- Consider scaling to multiple instances
- Optimize Dockerfile for faster builds
Issue: Connection Refused
Symptoms: Cannot access the application URL
Solutions:
- Verify traffic type is set to HTTP
- Confirm internal port matches Cryptgeon’s listening port (5000)
- Check deployment status in dashboard
- Review container logs for startup errors
- Ensure no firewall blocking access
Debugging Commands
Access your container logs:
- Navigate to your app in Klutch.sh dashboard
- Go to Logs section
- 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:
# 1. Create and initialize repositorymkdir cryptgeon-productioncd cryptgeon-productiongit init
# 2. Create Dockerfilecat > Dockerfile << 'EOF'FROM cryptgeon/cryptgeon:latestEXPOSE 5000EOF
# 3. Create READMEcat > README.md << 'EOF'# Cryptgeon Deployment
Production deployment of Cryptgeon on Klutch.sh.
## Configuration
- Port: 5000- Volume: /data- Environment variables configured in Klutch.sh dashboardEOF
# 4. Commit and pushgit add .git commit -m "Initial Cryptgeon deployment"git remote add origin https://github.com/yourusername/cryptgeon-production.gitgit push -u origin mainThen follow the deployment steps in the Klutch.sh dashboard as outlined above.
Updating Your Deployment
To update your Cryptgeon instance:
- Update the image tag in your Dockerfile (e.g.,
FROM cryptgeon/cryptgeon:v2.0.0) - Commit and push changes to GitHub
- In Klutch.sh dashboard, navigate to your app
- Click “Redeploy” or trigger automatic deployment via GitHub integration
- Monitor the deployment progress
- Verify the new version is running correctly
Resources and Further Reading
- Cryptgeon Official GitHub Repository
- Cryptgeon Official Website
- Klutch.sh Quick Start Guide
- Klutch.sh Volumes Documentation
- Klutch.sh Deployments Guide
- Custom Domains Configuration
- Docker Dockerfile Reference
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.