Skip to content

Deploying Databunker

Databunker is a privacy-focused personal data storage vault designed to help organizations comply with GDPR, CCPA, and other data privacy regulations. Built with Go and featuring strong encryption, Databunker acts as a secure intermediary between your applications and personally identifiable information (PII). Instead of scattering user data across multiple databases and tables, Databunker centralizes sensitive information in an encrypted vault with built-in audit logging, consent management, and automated data lifecycle controls.

What makes Databunker unique is its approach to privacy by design. The system stores all personal data encrypted at rest with individual user tokens serving as keys. Features like automatic PII tokenization, forgotten user requests, time-limited data retention, session management, and detailed audit trails make it straightforward to implement privacy-compliant architectures. Whether you’re building a new application or retrofitting an existing system, Databunker provides the infrastructure for managing sensitive data without reimplementing compliance features from scratch.

Why Deploy Databunker on Klutch.sh?

Deploying Databunker on Klutch.sh offers several advantages for hosting your privacy vault:

  • Automatic Docker Detection: Klutch.sh automatically recognizes your Dockerfile and handles the containerization process without manual configuration
  • Persistent Storage: Built-in volume management ensures your encrypted data, audit logs, and configuration persist across deployments
  • Simple HTTP Routing: Access your API through HTTPS with automatic SSL certificate provisioning
  • Database Connectivity: Connect Databunker to external databases or co-locate with database containers using TCP traffic routing
  • Environment Management: Securely store encryption keys, database credentials, and API tokens through environment variables
  • Rapid Deployment: Go from configuration to production in minutes with GitHub integration and automated deployment pipelines
  • Resource Efficiency: Databunker’s lightweight Go architecture makes it cost-effective to host on containerized infrastructure

Prerequisites

Before deploying Databunker to Klutch.sh, ensure you have:

  • A Klutch.sh account (sign up here)
  • A GitHub account with a repository for your Databunker deployment
  • Basic understanding of Docker and containerization concepts
  • Familiarity with REST APIs and JSON
  • Understanding of data privacy concepts and GDPR requirements
  • Git installed on your local development machine
  • Optional: PostgreSQL or MySQL database for production use

Understanding Databunker Architecture

Databunker follows a secure vault architecture designed for privacy compliance:

Core Components

Go Backend Server

The backend is written in Go, providing a high-performance REST API that handles all data operations. The server manages encryption, tokenization, audit logging, and data lifecycle operations. Go’s efficient memory management and concurrency make Databunker capable of handling thousands of requests per second while maintaining strong security guarantees.

Encryption Layer

All personal data is encrypted at rest using AES-256 encryption. Each user’s data is encrypted with a unique encryption key derived from their user token. This approach ensures that even if the database is compromised, the encrypted data remains unreadable without the corresponding tokens. The encryption happens transparently at the application layer before data reaches the database.

Token System

Databunker uses a token-based identification system where each user is assigned a unique token. Applications reference users by these tokens rather than storing actual personal data. Tokens can be generated in multiple formats (UUID, custom format) and can be associated with different identity types (email, phone, custom identifiers).

Database Layer

Databunker supports multiple database backends:

  • SQLite: Embedded database for development and small deployments
  • PostgreSQL: Recommended for production deployments requiring scalability
  • MySQL/MariaDB: Alternative production database option

The database stores encrypted user records, audit logs, consent records, and application configuration. All queries are parameterized to prevent SQL injection attacks.

Audit Logging

Every operation that accesses or modifies personal data is logged with timestamps, operation types, and administrator details. Audit logs are tamper-proof and provide complete visibility into who accessed what data and when. This is critical for demonstrating compliance with data protection regulations.

Consent Management

Databunker includes a built-in consent management system that tracks user agreements for different data processing purposes. Applications can query consent status before performing operations and Databunker ensures consent is properly documented and enforced.

Data Retention Policies

Automatic data lifecycle management allows setting retention periods for different data types. When retention periods expire, Databunker can automatically anonymize or delete personal data, helping organizations comply with data minimization principles.

Data Flow

  1. Application makes API request to store user data
  2. Databunker validates the request and generates a user token
  3. Personal data is encrypted using the user token as the encryption key
  4. Encrypted data is stored in the database
  5. User token is returned to the application
  6. Application stores only the token, not the actual personal data
  7. Future requests use the token to retrieve decrypted data
  8. All operations are logged to the audit trail
  9. Data retention policies automatically manage data lifecycle

Storage Requirements

Databunker requires persistent storage for:

  • Database: Encrypted user records, consent data, and session information (grows with users)
  • Audit Logs: Complete operation history (grows continuously)
  • Configuration: Application settings and encryption keys
  • Backups: Automated backup files if enabled

A typical deployment might use 100MB-1GB initially, but storage needs grow based on the number of users and audit log retention policies.

Installation and Setup

Let’s walk through setting up Databunker for deployment on Klutch.sh.

Step 1: Create the Project Structure

First, create a new directory for your Databunker deployment:

Terminal window
mkdir databunker-deployment
cd databunker-deployment
git init

Step 2: Create the Dockerfile

Create a Dockerfile in the root directory:

FROM golang:1.21-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git make gcc musl-dev
# Set working directory
WORKDIR /build
# Clone Databunker repository
RUN git clone https://github.com/securitybunker/databunker.git .
# Build the application
RUN go mod download
RUN CGO_ENABLED=1 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o databunker ./src/
# Production stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata
# Create app user
RUN addgroup -g 1000 databunker && \
adduser -D -u 1000 -G databunker databunker
# Create necessary directories
RUN mkdir -p /databunker/data /databunker/certs
# Copy built application
COPY --from=builder /build/databunker /usr/local/bin/databunker
# Set permissions
RUN chown -R databunker:databunker /databunker
# Switch to app user
USER databunker
# Set working directory
WORKDIR /databunker
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/v1/health || exit 1
# Start Databunker
CMD ["databunker"]

Step 3: Create Environment Configuration

Create a .env.example file with configuration options:

Terminal window
# Database Configuration
DATABUNKER_MASTERKEY=CHANGE-THIS-MASTER-KEY-TO-SECURE-RANDOM-STRING
# Database Type: sqlite3, postgres, mysql
DATABUNKER_DB=sqlite3
# SQLite Configuration (for development)
DATABUNKER_SQLITE_FILE=/databunker/data/databunker.db
# PostgreSQL Configuration (for production)
# DATABUNKER_DB=postgres
# DATABUNKER_POSTGRES_HOST=postgres-app.klutch.sh
# DATABUNKER_POSTGRES_PORT=8000
# DATABUNKER_POSTGRES_USER=databunker
# DATABUNKER_POSTGRES_PASSWORD=your-secure-password
# DATABUNKER_POSTGRES_DB=databunker
# DATABUNKER_POSTGRES_SSLMODE=require
# MySQL Configuration (alternative production option)
# DATABUNKER_DB=mysql
# DATABUNKER_MYSQL_HOST=mysql-app.klutch.sh
# DATABUNKER_MYSQL_PORT=8000
# DATABUNKER_MYSQL_USER=databunker
# DATABUNKER_MYSQL_PASSWORD=your-secure-password
# DATABUNKER_MYSQL_DB=databunker
# Server Configuration
DATABUNKER_PORT=3000
# Root Token (administrative access)
DATABUNKER_ROOTTOKEN=CHANGE-THIS-ROOT-TOKEN-TO-SECURE-RANDOM-STRING
# Notification Settings
# DATABUNKER_SMTP_SERVER=smtp.example.com:587
# DATABUNKER_SMTP_USER=notifications@example.com
# DATABUNKER_SMTP_PASS=smtp-password
# DATABUNKER_SMTP_SENDER=noreply@example.com
# Logging
DATABUNKER_LOGLEVEL=info

Step 4: Create .dockerignore

Create a .dockerignore file to optimize the build:

.git
.gitignore
.env
.env.local
*.md
README.md
.DS_Store
Thumbs.db
node_modules
dist/
build/
*.log

Step 5: Create README

Create README.md with deployment information:

# Databunker Privacy Vault
This repository contains the configuration for deploying Databunker on Klutch.sh.
## Features
- GDPR-compliant personal data storage
- AES-256 encryption at rest
- Comprehensive audit logging
- Consent management
- Automatic data retention
- RESTful API
## Configuration
Copy `.env.example` to `.env` and configure your environment variables.
## Deployment
This application is configured to deploy on Klutch.sh with automatic Docker detection.
## Security
- Always use strong, randomly generated values for `DATABUNKER_MASTERKEY` and `DATABUNKER_ROOTTOKEN`
- Use PostgreSQL or MySQL for production deployments
- Enable HTTPS (automatically provided by Klutch.sh)
- Regularly backup your database

Step 6: Initialize Git Repository

Terminal window
git add .
git commit -m "Initial Databunker setup for Klutch.sh deployment"
git branch -M master
git remote add origin https://github.com/yourusername/databunker-deployment.git
git push -u origin master

Deploying to Klutch.sh

Now that your Databunker application is configured, let’s deploy it to Klutch.sh.

  1. Log in to Klutch.sh

    Navigate to klutch.sh/app and sign in with your GitHub account.

  2. Create a New Project

    Click “New Project” and select “Import from GitHub”. Choose the repository containing your Databunker deployment.

  3. Configure Build Settings

    Klutch.sh will automatically detect the Dockerfile in your repository. The platform will use this for building your container.

  4. Configure Traffic Settings

    Select “HTTP” as the traffic type. Databunker serves its API on port 3000, and Klutch.sh will route HTTPS traffic to this port.

  5. Set Environment Variables

    In the project settings, add the following environment variables:

    • DATABUNKER_MASTERKEY: Generate a strong random string (use openssl rand -hex 32)
    • DATABUNKER_ROOTTOKEN: Generate a strong random string for API access
    • DATABUNKER_DB: sqlite3 (for testing) or postgres (for production)
    • DATABUNKER_PORT: 3000
    • DATABUNKER_LOGLEVEL: info

    For production with PostgreSQL, also add:

    • DATABUNKER_POSTGRES_HOST: Your database hostname
    • DATABUNKER_POSTGRES_PORT: 8000 (if using Klutch.sh database)
    • DATABUNKER_POSTGRES_USER: databunker
    • DATABUNKER_POSTGRES_PASSWORD: Your database password
    • DATABUNKER_POSTGRES_DB: databunker
    • DATABUNKER_POSTGRES_SSLMODE: require
  6. Configure Persistent Storage

    Databunker requires persistent storage for data and logs:

    • Data Volume (if using SQLite):
      • Mount path: /databunker/data
      • Size: 5GB

    This volume ensures your database and configuration persist across deployments.

  7. Deploy the Application

    Click “Deploy” to start the build process. Klutch.sh will:

    • Clone your repository
    • Build the Docker image using your Dockerfile
    • Deploy the container with the specified configuration
    • Provision an HTTPS endpoint

    The build process may take 3-5 minutes as it compiles the Go application.

  8. Access Your Instance

    Once deployment completes, Klutch.sh will provide a URL like example-app.klutch.sh. Your Databunker API will be available at this URL.

Getting Started with Databunker

Once your Databunker instance is deployed, here’s how to use it:

API Authentication

All API requests require authentication using the root token:

Terminal window
export DATABUNKER_URL="https://example-app.klutch.sh"
export DATABUNKER_TOKEN="your-root-token"

Creating a User

Store personal data for a new user:

Terminal window
curl -X POST $DATABUNKER_URL/v1/user \
-H "X-Bunker-Token: $DATABUNKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"phone": "+1-555-0123",
"custom": {
"dateOfBirth": "1990-01-01",
"address": "123 Main St, City, State"
}
}'

Response:

{
"status": "ok",
"token": "d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d"
}

The returned token is used to reference this user in all future operations.

Retrieving User Data

Get user data by token:

Terminal window
curl -X GET $DATABUNKER_URL/v1/user/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Get user data by email:

Terminal window
curl -X GET $DATABUNKER_URL/v1/user/email/user@example.com \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Updating User Data

Update existing user information:

Terminal window
curl -X PUT $DATABUNKER_URL/v1/user/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1-555-0124",
"custom": {
"address": "456 Oak Ave, New City, State"
}
}'

Record user consent for data processing:

Terminal window
curl -X POST $DATABUNKER_URL/v1/consent/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"brief": "marketing_emails",
"status": "accept",
"message": "User accepted marketing emails",
"lawfulbasis": "consent"
}'

Check consent status:

Terminal window
curl -X GET $DATABUNKER_URL/v1/consent/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d/marketing_emails \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Session Management

Create a user session:

Terminal window
curl -X POST $DATABUNKER_URL/v1/session/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": {
"login_time": "2025-12-05T10:00:00Z",
"ip_address": "192.168.1.1"
}
}'

Response:

{
"status": "ok",
"session": "session-token-abc123"
}

Retrieve session data:

Terminal window
curl -X GET $DATABUNKER_URL/v1/session/session-token-abc123 \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Accessing Audit Logs

View audit trail for a specific user:

Terminal window
curl -X GET $DATABUNKER_URL/v1/audit/list/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

View all audit logs:

Terminal window
curl -X GET "$DATABUNKER_URL/v1/audit/list?limit=100" \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Handling Data Subject Requests

Right to Access - Get all data for a user:

Terminal window
curl -X GET $DATABUNKER_URL/v1/user/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Right to Erasure - Delete user data:

Terminal window
curl -X DELETE $DATABUNKER_URL/v1/user/token/d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d \
-H "X-Bunker-Token: $DATABUNKER_TOKEN"

Right to Rectification - Update incorrect data (use the update endpoint shown earlier)

Advanced Configuration

Production Database Setup

For production deployments, use PostgreSQL for better scalability and reliability.

Step 1: Deploy PostgreSQL on Klutch.sh

Create a new project with a PostgreSQL Dockerfile or use a managed database service.

Step 2: Configure Databunker Connection

Update your environment variables:

Terminal window
DATABUNKER_DB=postgres
DATABUNKER_POSTGRES_HOST=your-postgres-host.klutch.sh
DATABUNKER_POSTGRES_PORT=8000
DATABUNKER_POSTGRES_USER=databunker
DATABUNKER_POSTGRES_PASSWORD=secure-password
DATABUNKER_POSTGRES_DB=databunker
DATABUNKER_POSTGRES_SSLMODE=require

Email Notifications

Configure SMTP for sending notifications to users:

Terminal window
DATABUNKER_SMTP_SERVER=smtp.sendgrid.net:587
DATABUNKER_SMTP_USER=apikey
DATABUNKER_SMTP_PASS=your-sendgrid-api-key
DATABUNKER_SMTP_SENDER=noreply@yourdomain.com

Custom Token Format

Generate user tokens with a custom prefix:

Terminal window
DATABUNKER_TOKEN_PREFIX=usr_

This will generate tokens like usr_d5c8a9f0-7b3e-4a2d-9c1f-8e7d6b5a4c3d.

Data Retention Policies

Configure automatic data deletion after a retention period:

Terminal window
DATABUNKER_RETENTION_DAYS=365

API Rate Limiting

Protect your API from abuse with rate limiting:

Terminal window
DATABUNKER_RATELIMIT_ENABLED=true
DATABUNKER_RATELIMIT_REQUESTS=100
DATABUNKER_RATELIMIT_WINDOW=60

CORS Configuration

Allow cross-origin requests from your frontend applications:

Terminal window
DATABUNKER_CORS_ENABLED=true
DATABUNKER_CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com

Application Integration

Node.js Integration

Install the Databunker client:

Terminal window
npm install @databunker/nodejs-client

Example usage:

const Databunker = require('@databunker/nodejs-client');
const databunker = new Databunker({
url: 'https://example-app.klutch.sh',
token: process.env.DATABUNKER_TOKEN
});
// Create user
async function createUser() {
const result = await databunker.users.create({
email: 'user@example.com',
firstName: 'John',
lastName: 'Doe'
});
console.log('User token:', result.token);
return result.token;
}
// Get user data
async function getUser(token) {
const user = await databunker.users.get({ token });
console.log('User data:', user);
return user;
}
// Update user data
async function updateUser(token) {
await databunker.users.update(token, {
phone: '+1-555-9999'
});
}
// Delete user
async function deleteUser(token) {
await databunker.users.delete(token);
}

Python Integration

Install the Databunker client:

Terminal window
pip install databunker

Example usage:

from databunker import Databunker
client = Databunker(
url='https://example-app.klutch.sh',
token='your-root-token'
)
# Create user
user = client.create_user({
'email': 'user@example.com',
'firstName': 'John',
'lastName': 'Doe'
})
print(f"User token: {user['token']}")
# Get user data
user_data = client.get_user_by_token(user['token'])
print(f"User data: {user_data}")
# Update user
client.update_user_by_token(user['token'], {
'phone': '+1-555-9999'
})
# Record consent
client.create_consent(user['token'], {
'brief': 'marketing_emails',
'status': 'accept',
'message': 'User accepted marketing emails'
})
# Delete user
client.delete_user_by_token(user['token'])

PHP Integration

Example using cURL:

<?php
class DatabunkerClient {
private $url;
private $token;
public function __construct($url, $token) {
$this->url = $url;
$this->token = $token;
}
public function createUser($userData) {
$ch = curl_init($this->url . '/v1/user');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Bunker-Token: ' . $this->token,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
public function getUser($userToken) {
$ch = curl_init($this->url . '/v1/user/token/' . $userToken);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Bunker-Token: ' . $this->token
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
}
$databunker = new DatabunkerClient(
'https://example-app.klutch.sh',
'your-root-token'
);
$result = $databunker->createUser([
'email' => 'user@example.com',
'firstName' => 'John',
'lastName' => 'Doe'
]);
echo "User token: " . $result['token'];
?>

Production Best Practices

Follow these recommendations for running Databunker in production:

Security

Strong Master Key

Always use a cryptographically secure master key:

Terminal window
openssl rand -hex 32

Never use default or weak keys in production.

Secure Root Token

Generate a strong root token and store it securely:

Terminal window
openssl rand -base64 32

Consider using multiple tokens with different permission levels for different services.

HTTPS Only

Ensure all traffic uses HTTPS (automatically enforced by Klutch.sh). Never expose Databunker over plain HTTP in production.

Network Isolation

If possible, keep Databunker in a private network accessible only to your application servers.

Database Management

Use PostgreSQL for Production

While SQLite works for development, use PostgreSQL or MySQL for production:

  • Better concurrency handling
  • Improved performance at scale
  • Advanced backup and replication features
  • Better suited for multi-container deployments

Regular Backups

Implement automated database backups:

Terminal window
# PostgreSQL backup
pg_dump -h postgres-host -U databunker databunker > backup.sql
# Restore
psql -h postgres-host -U databunker databunker < backup.sql

Schedule regular backups through Klutch.sh volume snapshots or external backup solutions.

Database Encryption

Use encrypted volumes for database storage and enable database-level encryption features when available.

Performance Optimization

Connection Pooling

Configure appropriate database connection pool sizes:

Terminal window
DATABUNKER_DB_MAX_OPEN_CONNS=25
DATABUNKER_DB_MAX_IDLE_CONNS=5

Caching

Implement application-level caching for frequently accessed data:

const cache = new Map();
const CACHE_TTL = 60000; // 1 minute
async function getCachedUser(token) {
if (cache.has(token)) {
const cached = cache.get(token);
if (Date.now() - cached.timestamp < CACHE_TTL) {
return cached.data;
}
}
const user = await databunker.users.get({ token });
cache.set(token, { data: user, timestamp: Date.now() });
return user;
}

Query Optimization

Use specific queries instead of fetching all data:

Terminal window
# Good: Get specific field
curl -X GET "$DATABUNKER_URL/v1/user/token/$TOKEN/field/email" \
-H "X-Bunker-Token: $ROOT_TOKEN"
# Avoid: Getting full record when only one field is needed

Monitoring and Logging

Health Checks

Monitor the health endpoint:

Terminal window
curl -X GET https://example-app.klutch.sh/v1/health

Set up automated monitoring to alert on failures.

Audit Log Retention

Configure appropriate audit log retention:

Terminal window
DATABUNKER_AUDIT_RETENTION_DAYS=90

Balance compliance requirements with storage costs.

Log Aggregation

Forward logs to a centralized logging system:

Terminal window
DATABUNKER_LOGLEVEL=info
DATABUNKER_LOG_FORMAT=json

Use tools like ELK stack, Datadog, or CloudWatch for log analysis.

Metrics and Alerting

Track key metrics:

  • API response times
  • Error rates
  • Database query performance
  • Storage utilization
  • Active sessions

Compliance and Auditing

Regular Access Reviews

Periodically review who has access to the root token and Databunker admin interface.

Data Subject Requests

Implement automated workflows for handling:

  • Right to access requests
  • Right to erasure requests
  • Right to rectification requests
  • Data portability requests

Consent Management

Maintain detailed consent records:

Terminal window
curl -X POST $DATABUNKER_URL/v1/consent/token/$TOKEN \
-H "X-Bunker-Token: $ROOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"brief": "gdpr_processing",
"status": "accept",
"message": "User accepted GDPR terms",
"lawfulbasis": "consent",
"starttime": "2025-12-05T00:00:00Z",
"endtime": "2026-12-05T00:00:00Z"
}'

Documentation

Maintain documentation of:

  • Data processing activities
  • Security measures implemented
  • Incident response procedures
  • Backup and recovery procedures

Troubleshooting

Connection Issues

Problem: Cannot connect to Databunker API

Solutions:

  • Verify the deployment is running in Klutch.sh dashboard
  • Check that HTTPS is working (visit your URL)
  • Ensure DATABUNKER_PORT is set to 3000
  • Verify root token is correct
  • Check browser console for CORS errors
  • Test with curl to isolate client issues

Problem: Database connection failures

Solutions:

  • Verify database credentials are correct
  • Check that database host and port are accessible
  • Ensure database exists and is initialized
  • Review database connection logs
  • Test database connectivity with psql or mysql client
  • Verify SSL/TLS settings match database requirements

Authentication Issues

Problem: “Invalid token” errors

Solutions:

  • Verify you’re using the root token from environment variables
  • Check that X-Bunker-Token header is set correctly
  • Ensure token doesn’t have extra whitespace
  • Verify token hasn’t been rotated or changed
  • Check API endpoint URL is correct

Problem: User tokens not working

Solutions:

  • Verify user token was returned during creation
  • Check that token format matches expected pattern
  • Ensure token hasn’t expired (if expiration is configured)
  • Verify you’re using the correct token type (user vs session vs root)

Data Issues

Problem: Encrypted data cannot be decrypted

Solutions:

  • Verify DATABUNKER_MASTERKEY hasn’t changed
  • Ensure master key is consistent across deployments
  • Check that database hasn’t been corrupted
  • Review encryption-related error logs
  • Never change the master key after data is encrypted

Problem: User creation fails

Solutions:

  • Validate JSON payload format
  • Ensure required fields are present (email or login)
  • Check for duplicate users (email/phone conflicts)
  • Verify database has sufficient storage
  • Review validation error messages
  • Check character encoding for special characters

Performance Issues

Problem: Slow API responses

Solutions:

  • Check database query performance
  • Review database connection pool settings
  • Monitor database resource utilization
  • Implement caching for frequently accessed data
  • Optimize queries to fetch only needed data
  • Scale database resources if needed
  • Review audit log size and cleanup old entries

Problem: High memory usage

Solutions:

  • Check for memory leaks in application code
  • Review database connection pool size
  • Reduce cache size if using application caching
  • Monitor goroutine count (Go specific)
  • Restart container if memory doesn’t stabilize
  • Increase container memory limits in Klutch.sh

Storage Issues

Problem: Running out of disk space

Solutions:

  • Increase volume size in Klutch.sh settings
  • Implement audit log cleanup policies
  • Review data retention settings
  • Delete old sessions and temporary data
  • Optimize database by running VACUUM (PostgreSQL)
  • Archive old audit logs to external storage

Problem: Volume not persisting data

Solutions:

  • Verify volume mount path is correct (/databunker/data)
  • Check that volume is attached in Klutch.sh dashboard
  • Ensure adequate volume size is allocated
  • Review file permissions in container
  • Test write access to mounted volume

Additional Resources

Conclusion

Databunker provides a robust solution for managing personal data with privacy and compliance built in from the ground up. By centralizing sensitive information in an encrypted vault, you can simplify GDPR compliance, respond quickly to data subject requests, and maintain detailed audit trails of all data access.

Deploying on Klutch.sh gives you the benefits of containerized hosting with automatic HTTPS, persistent storage, and straightforward deployment workflows. Whether you’re building a new privacy-conscious application or retrofitting an existing system to meet compliance requirements, Databunker on Klutch.sh provides the infrastructure you need to protect user data while maintaining developer productivity.

Start your privacy-focused architecture today and give your users the data protection they deserve.