Skip to main content

Unicis Platform

Community Edition (Self-Hosted) - Unicis.Tech OÜ Docs

How to install and self-host Unicis Platform Community Edition on your own server using Docker or CapRover.

Community

This guide walks you through self-hosting the Unicis Platform Community Edition on your own server. This is the free, open-source version of Unicis Platform, licensed under Apache License 2.0.

Prerequisites

Your server must meet the following requirements:

Manual Setup

1. Fork and Clone the Repository

Fork the repository on GitHub, then clone it:

git clone https://github.com/<your_github_username>/unicis-platform-ce.git
cd unicis-platform-ce

2. Install Dependencies

npm install

3. Configure the Environment

Copy the example environment file:

cp .env.example .env

Edit .env with your values. See the Environment Variables section below for a full reference.

4. Set Up the Database

To spin up a local PostgreSQL instance using Docker:

docker-compose up -d

Apply the database schema:

npx prisma db push

5. Start the Server

In development mode:

npm run dev

Access the platform at:

http://localhost:4002

Docker

Use the official Docker image from Docker Hub: unicis-platform-ce.

CapRover

CapRover provides a one-click deployment option. You will need CapRover installed on your server first.

Create the following files in your project root:

captain-definition

{
  "schemaVersion": 2,
  "dockerfilePath": "./Dockerfile"
}

Dockerfile (sample)

# Use the official Node.js image as the base image
FROM node:18.18.2

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install dependencies
RUN npm install --force

# Copy the entire application to the working directory
COPY . .

# Expose the port on which your Next.js app will run
EXPOSE 4002

ARG NEXTAUTH_URL=${NEXTAUTH_URL}
ENV NEXTAUTH_URL=${NEXTAUTH_URL}
ARG NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
ARG SMTP_HOST=${SMTP_HOST}
ENV SMTP_HOST=${SMTP_HOST}
ARG SMTP_PORT=${SMTP_PORT}
ENV SMTP_PORT=${SMTP_PORT}
ARG SMTP_USER=${SMTP_USER}
ENV SMTP_USER=${SMTP_USER}
ARG SMTP_PASSWORD=${SMTP_PASSWORD}
ENV SMTP_PASSWORD=${SMTP_PASSWORD}
ARG SMTP_FROM=${SMTP_FROM}
ENV SMTP_FROM=${SMTP_FROM}
ARG BILLING_EMAIL=${BILLING_EMAIL}
ENV BILLING_EMAIL=${BILLING_EMAIL}
ARG DATABASE_URL=${DATABASE_URL}
ENV DATABASE_URL=${DATABASE_URL}
ARG APP_URL=${APP_URL}
ENV APP_URL=${APP_URL}
ARG SVIX_URL=${SVIX_URL}
ENV SVIX_URL=${SVIX_URL}
ARG SVIX_API_KEY=${SVIX_API_KEY}
ENV SVIX_API_KEY=${SVIX_API_KEY}
ARG CONFIRM_EMAIL=${CONFIRM_EMAIL}
ENV CONFIRM_EMAIL=${CONFIRM_EMAIL}
ARG RESEND_API_KEY=${RESEND_API_KEY}
ENV RESEND_API_KEY=${RESEND_API_KEY}
ARG RESEND_FROM=${RESEND_FROM}
ENV RESEND_FROM=${RESEND_FROM}

# Build the Next.js app
RUN npm run build

# Start the Next.js app
CMD ["npm", "start"]

CapRover PostgreSQL Setup

In CapRover:

  1. Go to AppsOne-Click Apps/Database
  2. Search for PostgreSQL
  3. Enter your app name, version, username, password, and database name
  4. Click Deploy

Use these variables in your CapRover PostgreSQL app configuration:

POSTGRES_USER=platform
POSTGRES_PASSWORD=[your_password]
POSTGRES_DB=unicis_platform
POSTGRES_INITDB_ARGS=

Port mapping: server port 5432 → container port 5432

Then add your environment variables to the CapRover application configuration.

Environment Variables

Below is the full reference for .env.example:

# Only required for localhost
NEXTAUTH_URL=http://localhost:4002

# Generate with: openssl rand -base64 32
NEXTAUTH_SECRET=

# SMTP / Email settings
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM=
BILLING_EMAIL=

# AI (LLAMA API)
LLAMA_TOKEN=

# Database
DATABASE_URL=postgresql://<USER>:<PASSWORD>@localhost:5432/<DB_NAME>

# App URL
APP_URL=http://localhost:4002

# Webhooks (Svix)
SVIX_URL=https://api.eu.svix.com
SVIX_API_KEY=

# OAuth Providers
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# Audit Logs (Retraced)
RETRACED_URL=
RETRACED_API_KEY=
RETRACED_PROJECT_ID=

# Hide landing page and redirect to login
HIDE_LANDING_PAGE=false

# SSO group prefix (e.g. unicis-admin → admin)
GROUP_PREFIX=unicis-

# Require email confirmation before accessing app features
CONFIRM_EMAIL=false

# Disable non-business email signup
DISABLE_NON_BUSINESS_EMAIL_SIGNUP=false

# Auth providers (comma-separated: github, google, saml, email, credentials)
AUTH_PROVIDERS=

# OpenTelemetry
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=
OTEL_EXPORTER_OTLP_METRICS_HEADERS=
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=grpc
OTEL_EXPORTER_DEBUG=true
OTEL_PREFIX=unicis.saas

# Legal pages
NEXT_PUBLIC_TERMS_URL='/terms'
NEXT_PUBLIC_PRIVACY_URL='/privacy'

# Dark mode
NEXT_PUBLIC_DARK_MODE=false

# Team features
FEATURE_TEAM_SSO=true
FEATURE_TEAM_DSYNC=true
FEATURE_TEAM_AUDIT_LOG=true
FEATURE_TEAM_WEBHOOK=true
FEATURE_TEAM_API_KEY=true

# Google reCAPTCHA
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=

Accessing the Platform

Once running, open your browser to:

http://localhost:4002

Support