This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Installation

    Install Piglet Run

    This tutorial guides you through installing Piglet Run on a fresh server.

    Prerequisites

    • OS: Linux (Ubuntu 22.04+, Debian 12+, RHEL 8+, Rocky 8+)
    • CPU: 2+ cores recommended
    • RAM: 4GB minimum, 8GB+ recommended
    • Disk: 40GB+ free space
    • Network: Internet access for package download

    Quick Install

    1. Install Pig CLI

    # Default (Cloudflare CDN)
    curl -fsSL https://repo.pigsty.io/pig | bash
    
    # China Mirror
    curl -fsSL https://repo.pigsty.cc/pig | bash
    

    2. Setup Repositories

    pig repo set          # Setup all required repositories
    

    3. Install Pigsty with Piglet Profile

    pig sty init          # Download Pigsty to ~/pigsty
    cd ~/pigsty
    ./configure -m piglet # Configure with piglet preset
    ./install.yml         # Run installation playbook
    

    Step-by-Step Installation

    Download and Install Pig

    curl -fsSL https://repo.pigsty.io/pig | bash
    

    Setup Repositories

    pig repo set                          # One-step repo setup
    pig repo add all --region china       # Use China mirrors if needed
    

    Install PostgreSQL and Extensions

    pig install pg17                      # Install PostgreSQL 17
    pig install pg_duckdb vector -v 17    # Install extensions
    

    Install Pigsty Distribution

    pig sty init                          # Download Pigsty
    pig sty boot                          # Install Ansible
    pig sty conf -m piglet                # Generate piglet config
    pig sty deploy                        # Run deployment
    

    Verify Installation

    After installation, check status:

    pig status                            # Check pig environment
    pig ext status                        # Check installed extensions
    pig pg status                         # Check PostgreSQL status
    

    Access the services:

    ServiceURL
    Homepagehttp://<ip>/
    VS Codehttp://<ip>/code
    Jupyterhttp://<ip>/jupyter
    Grafanahttp://<ip>/ui
    PostgreSQLpostgres://<ip>:5432

    Troubleshooting

    Check Logs

    pig pg log tail                       # PostgreSQL logs
    pig pt log -f                         # Patroni logs (if HA enabled)
    

    Common Issues

    IssueSolution
    Repository errorpig repo set -u to refresh
    Package conflictpig repo rm then pig repo set
    Permission deniedRun with sudo or as root

    Next Steps