Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 80 additions & 5 deletions content/docs/1.getting-started/1.introduction.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,85 @@
---
title: "Introduction"
description: ""
description: "Welcome to Cosmify - A self-hosted Platform as a Service (PaaS) solution"
---

Coming soon!
# Introduction

```typescript [intro.ts]
Hello, world!
```
Welcome to **Cosmify**, a powerful self-hosted Platform as a Service (PaaS) that gives you complete control over your infrastructure without vendor lock-in.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useless because it will be added via the Description in the metadata


## What is Cosmify?

Cosmify is an open-source platform that enables you to deploy, manage, and scale applications on your own infrastructure. Think of it as your own Heroku or Platform.sh, but running on servers you control.

## Key Features

### 🚀 Self-Hosted Deployment
Deploy applications and manage infrastructure effortlessly on your own servers or cloud provider of choice.

### ☁️ Multi-Cloud Support
Works seamlessly with various cloud providers (AWS, DigitalOcean, Hetzner, etc.) or self-hosted environments.

### 🎨 User-Friendly UI
A clean and intuitive dashboard built with Vue.js for better usability and management.

### 🐳 Docker-Based
Leverages Docker for containerized deployments, ensuring consistency across environments.

### 🔐 Secure by Design
Built-in security measures including authentication, authorization, and isolated environments.

### 📊 Organization Management
Multi-tenancy support with organizations, projects, and role-based access control.

## Core Capabilities

Cosmify currently provides:

- **Project Management**: Organize your applications into projects
- **Container Orchestration**: Deploy and manage Docker containers
- **Network Management**: Configure virtual networks for your applications
- **Server Management**: Connect and manage multiple servers
- **Environment Variables**: Secure configuration management
- **Port Mapping**: Expose your applications to the internet

## Coming Soon

Cosmify is actively being developed. Upcoming features include:

- **Database Management**: Deploy and manage PostgreSQL, MySQL, Redis, and more
- **Automated Deployments**: Git-based workflows with GitHub and GitLab integration
- **Advanced Monitoring**: Built-in metrics, logging, and alerting
- **Load Balancing**: Distribute traffic across multiple instances
- **Backup & Recovery**: Automated backups for databases and volumes

## Why Choose Cosmify?

- **No Vendor Lock-In**: Your infrastructure, your rules
- **Cost Effective**: Pay only for your infrastructure costs
- **Full Control**: Complete access to your data and configurations
- **Open Source**: Transparent, auditable, and community-driven
- **Privacy First**: Your data stays on your infrastructure

## Who is Cosmify For?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this


Cosmify is ideal for:

- **Startups** looking for a cost-effective PaaS alternative
- **Development Teams** wanting control over their deployment pipeline
- **Agencies** managing multiple client applications
- **Enterprises** requiring on-premises or private cloud deployments
- **Developers** who want to learn about PaaS architecture

## Architecture

Cosmify consists of three main components:

1. **Backend API**: Express.js REST API handling all business logic
2. **Frontend Dashboard**: Vue.js web application for management
3. **PostgreSQL Database**: Stores all configuration and metadata

The platform communicates with your servers via SSH to manage Docker containers and orchestrate deployments.

## Next Steps

Ready to get started? Head over to the [Installation](/docs/getting-started/installation) guide to set up Cosmify on your infrastructure.
245 changes: 245 additions & 0 deletions content/docs/1.getting-started/2.installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
---
title: "Installation"
description: "Learn how to install and set up Cosmify on your infrastructure"
---

# Installation

This guide walks you through installing Cosmify on your infrastructure. Cosmify can be installed on a single server or distributed across multiple servers.

## Prerequisites

Before installing Cosmify, ensure you have:

- A server with **Ubuntu 20.04+** or **Debian 11+** (other Linux distributions may work but are untested)
- At least **2GB RAM** and **20GB disk space**
- **Docker** and **Docker Compose** installed
- **PostgreSQL 13+** (can be installed via Docker)
- **Node.js 18+** and **Yarn** (for building from source)
- **SSH access** with sudo privileges

## System Requirements

### Minimum Requirements
- **CPU**: 2 cores
- **RAM**: 2GB
- **Storage**: 20GB
- **OS**: Ubuntu 20.04+ or Debian 11+

### Recommended Requirements
- **CPU**: 4 cores
- **RAM**: 4GB
- **Storage**: 50GB SSD
- **OS**: Ubuntu 22.04 LTS

## Installation Methods

### Method 1: Docker Compose (Recommended)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for Development not production usage


The easiest way to get started with Cosmify is using Docker Compose.

#### Step 1: Clone the Repository

```bash
git clone https://github.com/cosmify-dev/cosmify.git
cd cosmify
```

#### Step 2: Configure Environment Variables

Create a `.env` file in the root directory:

```bash
cp .env.example .env
```

Edit the `.env` file with your configuration:

```bash
# Database Configuration
POSTGRES_HOST=database
POSTGRES_PORT=5432
POSTGRES_USER=admin
POSTGRES_PASSWORD=your_secure_password_here
POSTGRES_DB=cosmify

# Backend Configuration
BACKEND_PORT=3001
NODE_ENV=production

# Frontend Configuration
VITE_API_URL=http://localhost:3001

# Security
JWT_SECRET=your_jwt_secret_here
SESSION_SECRET=your_session_secret_here
```

#### Step 3: Start Services

Start the development environment:

```bash
docker-compose -f infra/docker-compose.dev.yml up -d
```

Or for production:

```bash
docker-compose up -d
```

#### Step 4: Access Cosmify

Open your browser and navigate to:
- **Frontend**: `http://localhost:3000`
- **Backend API**: `http://localhost:3001`

### Method 2: Manual Installation

For more control, you can install Cosmify manually.

#### Step 1: Install Dependencies

```bash
# Update system packages
sudo apt update && sudo apt upgrade -y

# Install Node.js 18
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs

# Install Yarn
npm install -g yarn

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

# Install PostgreSQL
sudo apt install -y postgresql postgresql-contrib
```

#### Step 2: Set Up Database

```bash
# Create database and user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done via migrations

sudo -u postgres psql <<EOF
CREATE DATABASE cosmify;
CREATE USER cosmify WITH ENCRYPTED PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE cosmify TO cosmify;
EOF
```

#### Step 3: Clone and Build

```bash
# Clone repository
git clone https://github.com/cosmify-dev/cosmify.git
cd cosmify

# Install dependencies
yarn install

# Build backend
yarn nx build backend

# Build frontend
yarn nx build frontend
```

#### Step 4: Configure Environment

Create environment files for both backend and frontend as described in Method 1.

#### Step 5: Start Services

```bash
# Start backend
yarn nx serve backend

# In another terminal, start frontend
yarn nx serve frontend
```

## Post-Installation

### Create Admin Account

After installation, create your first admin account by registering through the web interface at `http://localhost:3000`.

### Configure SSH Keys

To manage remote servers, you'll need to configure SSH access:

1. Generate an SSH key pair:
```bash
ssh-keygen -t ed25519 -C "cosmify@yourserver"
```

2. Add the public key to your target servers:
```bash
ssh-copy-id user@your-server-ip
```

3. Add the private key to Cosmify through the UI in Settings → SSH Keys.

## Firewall Configuration

If you're using a firewall, ensure these ports are accessible:

- **3000**: Frontend (HTTP)
- **3001**: Backend API (HTTP)
- **5432**: PostgreSQL (only if external access needed)
- **22**: SSH (for server management)

Example UFW rules:

```bash
sudo ufw allow 22/tcp
sudo ufw allow 3000/tcp
sudo ufw allow 3001/tcp
sudo ufw enable
```

## Updating Cosmify

To update to the latest version:

```bash
cd cosmify
git pull origin main
yarn install
yarn nx build backend
yarn nx build frontend
```

Then restart your services.

## Troubleshooting

### Database Connection Issues

If you can't connect to the database:

1. Check PostgreSQL is running: `sudo systemctl status postgresql`
2. Verify connection details in `.env`
3. Ensure PostgreSQL allows connections from your host

### Docker Permission Errors

If you get Docker permission errors:

```bash
sudo usermod -aG docker $USER
newgrp docker
```

### Port Already in Use

If ports 3000 or 3001 are in use, you can change them in your `.env` file.

## Next Steps

Now that Cosmify is installed, proceed to the [Quick Start](/docs/getting-started/quick-start) guide to deploy your first application.
Loading