Skip to main content

Clone Repository & Setup Environment

Clone the deployment repository from GitHub and configure environment variables.

Prerequisites

Before starting:

  • Completed Infrastructure Checklist
  • Docker and Git installed
  • GitHub repository access granted
  • SSL certificates obtained

Step 1: Clone Repository

Get Deploy Token

Contact your Chatty AI vendor to receive:

  • Repository URL: https://github.com/chattyai-org/chatty-app-deploy.git
  • Deploy Token: Personal access token for repository access

Clone Private Repository

Use the deploy token to authenticate:

# Method 1: Clone with token in URL (recommended for automation)
git clone https://<DEPLOY_TOKEN>@github.com/chattyai-org/chatty-app-deploy.git

# Method 2: Clone and enter token when prompted
git clone https://github.com/chattyai-org/chatty-app-deploy.git
# Username: <your-github-username>
# Password: <DEPLOY_TOKEN>

# Navigate to deploy directory
cd chatty-app-deploy/deploy

Example with token:

# Replace YOUR_DEPLOY_TOKEN with actual token
git clone https://ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@github.com/chattyai-org/chatty-app-deploy.git

🔒 Security Note:

  • Never commit the deploy token to version control
  • Keep the token secure and confidential
  • The token provides read-only access to the deployment repository

Repository Structure

chatty-app-deploy/
└── deploy/
├── docker-compose.yaml # Main compose file
├── .env.example # Environment template
├── ENV_DOCUMENTATION.md # All variables documented
├── README.md # Quick start guide
└── certs/ # SSL certificates directory
├── chattyai/
├── n8n/
└── databases/

Step 2: Create Environment File

Copy the example environment file:

cp .env.example .env

Step 3: Configure Required Variables

Edit the .env file:

nano .env

Domains (Required)

CHATTYAI_DOMAIN=chat.example.com
N8N_DOMAIN=n8n.example.com
DATABASES_DOMAIN=databases.example.com

Database Password (Required)

Generate secure password:

# Generate password
openssl rand -base64 32

# Add to .env
DB_PASSWORD=<generated-password>

JWT Secret (Required)

Generate JWT secret:

# Generate secret
openssl rand -hex 32

# Add to .env
CHATTYAI_JWT_SECRET_KEY=<generated-secret>

API Keys (Required)

Generate Chatty AI API key:

# Generate API key
echo "sk-chattyai-$(openssl rand -hex 16)"

# Add to .env
CHATTYAI_API_KEY=<generated-key>

Add LLM API key:

# Add your LLM provider API key
CHATTYAI_AI_API_KEY=sk-proj-your-llm-api-key

Admin Account (Required)

CHATTYAI_ADMIN_EMAIL=admin@company.com
CHATTYAI_ADMIN_NAME=Admin
CHATTYAI_ADMIN_PASSWORD=YourSecurePassword123!

Step 4: Configure URLs

Set the full URLs for each service:

# If using domains with HTTPS
CHATTYAI_URL=https://chat.example.com
N8N_URL=https://n8n.example.com
DATABASES_URL=https://databases.example.com

# If using IP addresses with HTTP
CHATTYAI_URL=http://192.168.1.100:3000
N8N_URL=http://192.168.1.100:5678
DATABASES_URL=http://192.168.1.100:8000

Step 5: Configure Optional Features

LDAP Authentication (Optional)

If using LDAP:

LDAP_SERVER_URL=ldap://ldap.company.com
LDAP_BIND_DN=cn=admin,dc=company,dc=com
LDAP_BIND_PASSWORD=ldap-password
LDAP_USER_BASE=ou=users,dc=company,dc=com
LDAP_SEARCH_FILTER=(uid={0})

See LDAP Configuration for details.

Microsoft SSO (Optional)

If using Microsoft Entra ID (Azure AD):

MICROSOFT_CLIENT_ID=12345678-1234-1234-1234-123456789012
MICROSOFT_CLIENT_SECRET=abc123~XYZ...
MICROSOFT_CLIENT_TENANT_ID=common
MICROSOFT_REDIRECT_URI=https://chat.example.com/oauth/microsoft/callback

Note: MICROSOFT_REDIRECT_URI must match the redirect URI configured in Azure App Registration.

See SSO Configuration for details.


Step 6: Place SSL Certificates

Create certificate directories:

# Create certificate directories
mkdir -p ../certs/chattyai
mkdir -p ../certs/n8n
mkdir -p ../certs/databases

Copy your certificates:

# Chatty AI certificates
cp /path/to/chattyai-fullchain.pem ../certs/chattyai/fullchain.pem
cp /path/to/chattyai-privkey.pem ../certs/chattyai/privkey.pem

# n8n certificates
cp /path/to/n8n-fullchain.pem ../certs/n8n/fullchain.pem
cp /path/to/n8n-privkey.pem ../certs/n8n/privkey.pem

# Databases certificates
cp /path/to/databases-fullchain.pem ../certs/databases/fullchain.pem
cp /path/to/databases-privkey.pem ../certs/databases/privkey.pem

# Set permissions
chmod 600 ../certs/*/privkey.pem
chmod 644 ../certs/*/fullchain.pem

Step 7: Verify Configuration

Check your configuration:

# Verify .env file
cat .env | grep -E "CHATTYAI_DOMAIN|DB_PASSWORD|CHATTYAI_JWT_SECRET_KEY"

# Verify certificates exist
ls -la ../certs/*/

Checklist:

  • All required variables set in .env
  • Secrets generated (not using example values)
  • SSL certificates in place
  • Certificate permissions correct (600 for privkey)
  • DNS records pointing to server

Complete .env Example

Minimal production configuration:

# Domains
CHATTYAI_DOMAIN=chat.example.com
N8N_DOMAIN=n8n.example.com
DATABASES_DOMAIN=databases.example.com

# URLs (must match domains)
CHATTYAI_URL=https://chat.example.com
N8N_URL=https://n8n.example.com
DATABASES_URL=https://databases.example.com

# Database
DB_USER=chattyAdmin
DB_NAME=chattydb
DB_PASSWORD=<generated-secure-password>

# Security
CHATTYAI_JWT_SECRET_KEY=<generated-hex-64-chars>
CHATTYAI_API_KEY=sk-chattyai-<generated-hex-32-chars>
CHATTYAI_AI_API_KEY=sk-proj-your-llm-api-key

# Admin
CHATTYAI_ADMIN_EMAIL=admin@company.com
CHATTYAI_ADMIN_NAME=Admin
CHATTYAI_ADMIN_PASSWORD=<your-secure-password>

# LLM
CHATTYAI_AI_API_BASE_URL=https://llm.chatty-ai.ai

# Image versions (use latest stable)
CHATTYAI_VERSION=arm64
PIPELINES_VERSION=amd64
DATABASES_VERSION=amd64
DATABASES_AI_VERSION=arm64
N8N_VERSION=amd64

See Environment Variables Overview for all variables.


Troubleshooting

Missing Variables

Check ENV_DOCUMENTATION.md for variable details:

cat ENV_DOCUMENTATION.md | grep CHATTYAI_DOMAIN

Certificate Issues

Verify certificate format:

# Check certificate
openssl x509 -in ../certs/chattyai/fullchain.pem -text -noout

# Check private key
openssl rsa -in ../certs/chattyai/privkey.pem -check

Next Steps

Once environment is configured:

  1. Run Deployment
  2. Post-Installation Validation

Reference