Skip to content

Deploying Para

Introduction

Para is a self-hosted backend server designed for building web and mobile applications quickly. It provides essential backend services including authentication, database operations, full-text search, and REST APIs out of the box, allowing developers to focus on building their applications rather than infrastructure.

Built with Java and designed for scalability, Para can serve as the complete backend for your applications or integrate alongside existing systems.

Key highlights of Para:

  • Multi-Tenant Architecture: Support multiple applications from a single Para instance
  • Built-in Authentication: OAuth 2.0, social logins, LDAP, and custom authentication providers
  • Flexible Data Storage: Support for multiple databases including MongoDB, Cassandra, and DynamoDB
  • Full-Text Search: Integrated Elasticsearch or Lucene for powerful search capabilities
  • REST API: Complete RESTful API for all operations
  • Caching: Built-in caching with support for Redis and Hazelcast
  • Webhooks: Trigger external services on data changes
  • Plugins: Extend functionality with the plugin system
  • Admin Console: Web-based interface for managing applications and data
  • Open Source: Licensed under Apache 2.0

This guide walks through deploying Para on Klutch.sh using Docker, configuring the backend for your applications, and setting up persistent storage.

Why Deploy Para on Klutch.sh

Deploying Para on Klutch.sh provides several advantages for your backend needs:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Para without complex orchestration. Push to GitHub, and your backend deploys automatically.

Persistent Storage: Attach persistent volumes for your data and search indices. Your data survives container restarts and redeployments.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure API access.

Environment Variable Management: Securely store database credentials, API keys, and secrets through Klutch.sh’s environment variable system.

Scalable Resources: Allocate CPU and memory based on your application load and data volume.

Custom Domains: Assign a professional domain to your Para API endpoints.

Prerequisites

Before deploying Para on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Para configuration
  • Basic familiarity with Docker and containerization concepts
  • (Optional) External database service for production deployments

Understanding Para Architecture

Para consists of several components:

Core Server: The main Java application handling API requests and business logic.

Data Access Object (DAO): Abstraction layer for database operations, supporting multiple backends.

Search: Full-text search engine integration with Elasticsearch or embedded Lucene.

Cache: Distributed caching layer for improved performance.

Authentication Module: Handles user authentication and authorization.

Preparing Your Repository

Create a GitHub repository containing your Dockerfile for Para deployment.

Repository Structure

para-deploy/
├── Dockerfile
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM erudikaltd/para:latest
# Set environment variables
ENV PARA_PORT=8080
ENV PARA_ENV=production
# Create data directories
RUN mkdir -p /para/data /para/lucene
# Expose the API port
EXPOSE 8080
# Start Para
CMD ["java", "-jar", "/para/para-war.jar"]

Advanced Dockerfile with Custom Configuration

For more control, use this extended Dockerfile:

FROM erudikaltd/para:latest
# Set environment variables
ENV PARA_PORT=8080
ENV PARA_ENV=production
ENV PARA_SEARCH=lucene
ENV PARA_DAO=h2
# Create data directories
RUN mkdir -p /para/data /para/lucene
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/v1/_health || exit 1
# Expose the API port
EXPOSE 8080
# Start Para
CMD ["java", "-jar", "/para/para-war.jar"]

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Environment Variables Reference

VariableRequiredDefaultDescription
PARA_SECRET_KEYYes-Secret key for JWT signing
PARA_ACCESS_KEYNo-Root access key
PARA_DAONoh2Database adapter (h2, mongodb, cassandra, dynamodb)
PARA_SEARCHNoluceneSearch adapter (lucene, elasticsearch)
PARA_CACHENocaffeineCache adapter (caffeine, hazelcast, redis)
PARA_PORTNo8080Server port
PARA_APP_NAMENoparaApplication name

Deploying Para on Klutch.sh

    Generate Secret Keys

    Generate secure keys for your Para deployment:

    Terminal window
    openssl rand -base64 32

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub with your Dockerfile.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “para” or “backend-server”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Para Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

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

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    PARA_SECRET_KEYYour generated secret key
    PARA_ACCESS_KEYYour root access key
    PARA_DAOh2 (or your preferred database)
    PARA_SEARCHlucene (or elasticsearch)

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /para/data10 GBDatabase storage (for H2)
    /para/lucene10 GBSearch indices

    Deploy Your Application

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

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Para container
    • Provision an HTTPS certificate

    Access Para

    Once deployment completes, access your Para API at https://your-app-name.klutch.sh/v1/.

Using Para

Creating Your First App

Para supports multiple applications. Create an app through the API:

Terminal window
curl -X POST "https://your-para-instance/v1/_setup" \
-H "Content-Type: application/json"

API Authentication

Para uses JWT tokens for API authentication. Obtain a token:

Terminal window
curl -X POST "https://your-para-instance/v1/_token" \
-H "Content-Type: application/json" \
-d '{"accessKey": "your-access-key", "secretKey": "your-secret-key"}'

Creating Objects

Store data in Para using the REST API:

Terminal window
curl -X POST "https://your-para-instance/v1/users" \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{"name": "John Doe", "email": "john@example.com"}'

Searching Data

Use Para’s search capabilities:

Terminal window
curl "https://your-para-instance/v1/users?q=John" \
-H "Authorization: Bearer your-token"

Admin Console

Para includes a web-based admin console for managing your applications:

  1. Access the console at https://your-para-instance/admin/
  2. Log in with your access and secret keys
  3. Browse and manage data, users, and settings

Integrating with Applications

Para provides client libraries for various platforms:

  • JavaScript: para-client-js
  • Java: para-client
  • Python: para-client-python
  • iOS: Para Swift client
  • Android: Para Java client

Additional Resources

Conclusion

Deploying Para on Klutch.sh gives you a powerful, self-hosted backend server with authentication, database, and search capabilities built in. The combination of Para’s feature-rich platform and Klutch.sh’s deployment simplicity means you can focus on building applications rather than managing infrastructure.

With multi-tenant support, flexible storage options, and comprehensive APIs, Para provides the foundation for building web and mobile applications quickly and efficiently.