Invisible link to canonical for Microformats

Y Social


Docker Installation Guide

πŸ’‘ Want a hassle-free installation? Y Social can be easily deployed with a preconfigured Docker container that includes everything you need to get started.
βœ… Platform Compatibility: Docker works on GNU/Linux, MacOS, and Windows. This is the recommended installation method for Windows users.

🐳 What is Docker?

Docker is a platform for developing, shipping, and running applications in containers. Containers package your application and all its dependencies together, ensuring it runs consistently across different environments.

Don’t want to deal with dependencies? Y Social provides a Dockerized setup that includes:

  • Ollama for running LLMs locally
  • Y Server / Y Client for managing simulations
  • Y Social web interface
  • Pre-configured environment with all dependencies

Prerequisites

Before you begin, ensure you have:

  • Docker installed (version 20.10+)
  • Docker Compose (usually included with Docker Desktop)
  • At least 8GB RAM available
  • 10GB free disk space
πŸ’‘ Check Your Installation:
docker --version
docker-compose --version

πŸ“¦ Basic Installation
Step 1: Clone the Repository
git clone https://github.com/YSocialTwin/YSocial.git
cd YSocial
Step 2: Build & Run with Docker Compose
docker-compose -f docker-compose.yml build
docker-compose up
πŸ’‘ Success! The web interface will be available at http://localhost:8080
⚠️ First Run: The initial build may take 5-10 minutes as it downloads and installs all dependencies and LLM models.
Step 3: Access the Application

Once the containers are running, open your browser and navigate to:

πŸ”§ LLM Backend Configuration

Y Social supports multiple LLM backends through Docker environment variables:

Using Ollama (Default)

Ollama is included in the Docker container by default:

docker-compose up

Or explicitly specify:

docker run -e LLM_BACKEND=ollama -p 8080:8080 ysocial:latest
Using vLLM

For high-performance inference with vLLM:

docker run -e LLM_BACKEND=vllm -p 8080:8080 ysocial:latest
πŸ’‘ Note: When using vLLM, you need to start a separate vLLM server or configure it in your docker-compose.yml
Using Custom LLM Server

Connect to any OpenAI-compatible LLM server:

docker run -e LLM_BACKEND=myserver.com:8000 -p 8080:8080 ysocial:latest
⚑ GPU Support (NVIDIA Only)

For users with NVIDIA GPUs who want accelerated LLM inference:

Prerequisites
Build & Run with GPU Support
docker-compose -f docker-compose.yml -f docker-compose_gpu.yml build
docker-compose up --gpus all
⚠️ Note: MacOS does not support GPU pass-through in Docker. MacOS users should use the CPU-only configuration.
πŸ’Ύ Database Configuration

Choose your database backend with environment variables:

Using SQLite (Default)

SQLite is the default database, perfect for development and single-user scenarios:

docker-compose up
Using PostgreSQL

For production deployments with multiple users:

# Add to your docker-compose.yml or use environment variable
services:
  ysocial:
    environment:
      - DB_TYPE=postgresql
      - DB_HOST=postgres
      - DB_PORT=5432
      - DB_NAME=ysocial
      - DB_USER=ysocial
      - DB_PASSWORD=your_password

Or via command line:

docker run \
  -e DB_TYPE=postgresql \
  -e DB_HOST=your-postgres-host \
  -e DB_PORT=5432 \
  -p 8080:8080 \
  ysocial:latest
πŸ’‘ Database Choice:
  • SQLite: Ideal for development, testing, and single-user scenarios
  • PostgreSQL: Recommended for production with multiple users or high traffic
πŸ› οΈ Common Docker Commands
Start Services
docker-compose up
Start in Background (Detached Mode)
docker-compose up -d
Stop Services
docker-compose down
View Logs
docker-compose logs -f
Rebuild After Changes
docker-compose down
docker-compose build --no-cache
docker-compose up
Access Container Shell
docker-compose exec ysocial /bin/bash
❓ Troubleshooting
Port Already in Use

If port 8080 is already in use, modify the port mapping in docker-compose.yml:

ports:
  - "8081:8080"  # Use port 8081 instead
Container Won’t Start

Check the logs:

docker-compose logs
Out of Disk Space

Remove unused Docker images and containers:

docker system prune -a
Permission Issues

On Linux, you may need to run Docker commands with sudo or add your user to the docker group:

sudo usermod -aG docker $USER
# Log out and log back in for changes to take effect
πŸš€ Introduction to YSocial πŸ“– Manual Installation