This is the multi-page printable view of this section. .
Tutorial
-
1: Installation
-
2: Quick Start
-
3: VS Code
-
4: Jupyter
-
5: Claude Code
-
6: Database
-
7: Application
Tutorial documentation provides step-by-step guides to learn Piglet Run from scratch.
Learning Path
Follow these tutorials in order to get started:
- Installation - Set up Piglet Run on your server
- Quick Start - Create your first project
- VS Code - Using the web-based VS Code
- Jupyter - Data analysis with Jupyter
- Claude Code - AI-assisted development
- Database - Working with PostgreSQL
Topics
| Topic | Description |
|---|---|
| Install | Install Piglet Run on a fresh server |
| Quick Start | Your first 5 minutes with Piglet Run |
| VS Code | Web-based VS Code tutorial |
| Jupyter | JupyterLab for data science |
| Claude Code | AI coding with Claude |
| Database | PostgreSQL basics |
| Application | Build and deploy an app |
1 - 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
2. Setup Repositories
3. Install Pigsty with Piglet Profile
Step-by-Step Installation
Download and Install Pig
Setup Repositories
Install PostgreSQL and Extensions
Install Pigsty Distribution
Verify Installation
After installation, check status:
Access the services:
| Service | URL |
|---|---|
| Homepage | http://<ip>/ |
| VS Code | http://<ip>/code |
| Jupyter | http://<ip>/jupyter |
| Grafana | http://<ip>/ui |
| PostgreSQL | postgres://<ip>:5432 |
Troubleshooting
Check Logs
Common Issues
| Issue | Solution |
|---|---|
| Repository error | pig repo set -u to refresh |
| Package conflict | pig repo rm then pig repo set |
| Permission denied | Run with sudo or as root |
Next Steps
- Continue with Quick Start
- Learn about VS Code
2 - Quick Start
Your First 5 Minutes
This tutorial gets you productive with Piglet Run in 5 minutes.
Access Your Environment
After installation, access your environment:
| Service | URL | Default Credentials |
|---|---|---|
| Homepage | http://<ip>/ |
None |
| VS Code | http://<ip>/code |
See /data/code/config.yaml |
| Jupyter | http://<ip>/jupyter |
Token in logs |
| Grafana | http://<ip>/ui |
admin / admin |
Create Your First Project
1. Open VS Code
Navigate to http://<ip>/code in your browser.
2. Open Terminal
Press Ctrl+` to open the integrated terminal.
3. Create a Project
4. Create a Simple App
Create app.py:
5. Run It
Connect to PostgreSQL
Or in Python:
Next Steps
- Learn more about VS Code
- Explore Jupyter
- Try Claude Code
3 - VS Code
Web-based VS Code
Learn to use the web-based VS Code server in Piglet Run.
Access
Open your browser and navigate to:
Features
The web VS Code includes:
- Full VS Code experience in browser
- Extensions support
- Integrated terminal
- Git integration
- Python, Go, Node.js support
Getting Started
1. Open a Folder
Click “Open Folder” and select /root/workspace.
2. Install Extensions
Recommended extensions:
- Python
- Pylance
- GitLens
- Database Client
3. Configure Settings
Press Ctrl+, to open settings.
Tips
- Use
Ctrl+Shift+Pfor command palette - `Ctrl+`` for integrated terminal
Ctrl+Bto toggle sidebar
Next Steps
- Try Jupyter
- Learn Claude Code
4 - Jupyter
JupyterLab Tutorial
Learn to use JupyterLab for data analysis in Piglet Run.
Access
Navigate to:
Features
- Interactive Python notebooks
- Rich output (charts, tables, images)
- PostgreSQL integration
- Multiple kernels (Python, SQL)
Getting Started
1. Create a Notebook
Click “Python 3” under Notebook.
2. Connect to PostgreSQL
3. Visualize Data
Tips
- Use
Shift+Enterto run cells - Save notebooks to
/root/workspace/notebooks
Next Steps
- Learn Claude Code
- Explore Database
5 - Claude Code
AI-Assisted Development
Learn to use Claude Code for AI-assisted development in Piglet Run.
Prerequisites
You need an Anthropic API key. Set it up:
Getting Started
1. Launch Claude Code
In VS Code terminal:
2. Give Instructions
Ask Claude to help with your project:
3. Review and Accept
Claude will:
- Analyze your request
- Generate code
- Explain the changes
- Wait for your approval
Best Practices
| Practice | Reason |
|---|---|
| Create snapshots | Roll back if needed |
| Review changes | Verify before accepting |
| Be specific | Better results |
| Iterate | Refine step by step |
Safety
Piglet Run makes AI coding safer:
- Snapshots: Restore any time
- Monitoring: Track AI activity
- Isolation: Sandboxed environment
Monitoring
View Claude Code activity at:
Next Steps
- Explore Database
- Build an Application
6 - Database
PostgreSQL Basics
Learn to work with PostgreSQL in Piglet Run.
Connect
Using psql
Using Python
Create Database
Install Extensions
PostgreSQL 18 with 400+ extensions available:
Basic Operations
Monitoring
View database performance at:
Next Steps
- Build an Application
- Learn about Backup
7 - Application
Build and Deploy
Learn to build and deploy a web application in Piglet Run.
Create a FastAPI App
1. Set Up Project
2. Create Application
Create main.py:
3. Run Locally
4. Deploy with Nginx
See Deploy Task for production deployment.