This is the multi-page printable view of this section. .
Task
Task documentation provides goal-oriented guides for specific operations.
How to Use
Each task guide focuses on accomplishing a specific goal:
- Problem-focused: Start with what you want to achieve
- Step-by-step: Clear instructions to follow
- Practical: Real-world scenarios
Topics
| Topic | Description |
|---|---|
| Backup | Backup database and files |
| Restore | Restore from backup or snapshot |
| Clone | Clone database or environment |
| Deploy | Deploy web application |
| SSL | Configure SSL certificates |
| Domain | Set up custom domain |
| Scale | Scale resources up or down |
| Migrate | Migrate data from other systems |
| Monitor | Set up alerts and monitoring |
| Upgrade | Upgrade Piglet Run |
1 - Backup
Learn how to backup your database and files in Piglet Run.
Overview
Piglet Run provides multiple backup methods to protect your data:
- Database Backup: Full and incremental PostgreSQL backups
- File Backup: User files and configurations
- Snapshot: Complete system state capture
Quick Backup
Create a full backup with a single command:
Backup Database
Full Database Backup
Incremental Backup
Backup Specific Database
Backup Files
Backup User Files
Backup Configurations
Scheduled Backups
Configure automatic backups in /etc/piglet/backup.yml:
Backup Storage
Backups are stored in:
| Type | Location |
|---|---|
| Database | /data/backup/postgres/ |
| Files | /data/backup/files/ |
| Config | /data/backup/config/ |
Next Steps
2 - Restore
Learn how to restore your database and files from backups or snapshots.
Overview
Piglet Run supports multiple restore scenarios:
- Point-in-Time Recovery: Restore to any moment in time
- Full Restore: Restore from a complete backup
- Selective Restore: Restore specific databases or files
Quick Restore
Restore from the latest backup:
Restore Database
List Available Backups
Restore Full Backup
Point-in-Time Recovery
Restore Specific Database
Restore Files
Restore All Files
Restore Specific Directory
Restore from Snapshot
Verification
After restore, verify data integrity:
Next Steps
3 - Clone
Learn how to clone databases and environments in Piglet Run.
Overview
Cloning allows you to create exact copies of:
- Database: Clone a database for testing or development
- Environment: Clone the entire Piglet Run instance
- Schema Only: Clone structure without data
Quick Clone
Clone a database instantly:
Clone Database
Full Clone
Schema Only
Clone with Data Filter
Clone Environment
Create Environment Clone
Clone to Remote Server
Clone from Snapshot
Clone Options
| Option | Description |
|---|---|
--schema-only |
Clone structure without data |
--no-owner |
Skip ownership information |
--no-privileges |
Skip privilege information |
--parallel N |
Use N parallel jobs |
Use Cases
- Development: Clone production for local development
- Testing: Create isolated test environments
- Analytics: Clone for reporting without impacting production
Next Steps
4 - Deploy
Learn how to deploy web applications on Piglet Run.
Overview
Piglet Run supports deploying various web applications:
- Static Sites: HTML, CSS, JavaScript
- Node.js: Express, Next.js, React
- Python: Flask, Django, FastAPI
- PHP: Laravel, WordPress
Quick Deploy
Deploy a static site:
Deploy Static Site
From Local Directory
From Git Repository
Deploy Node.js Application
Basic Deployment
With Custom Port
Configuration
Create piglet.yml in your project:
Deploy Python Application
Flask Application
Django Application
Deployment Management
List Deployments
View Logs
Restart Application
Remove Deployment
Next Steps
- Configure SSL for HTTPS
- Set up Custom Domain
5 - SSL
Learn how to configure SSL certificates for secure HTTPS connections.
Overview
Piglet Run supports multiple SSL certificate options:
- Let’s Encrypt: Free automatic certificates
- Self-Signed: For development and testing
- Custom: Bring your own certificates
Quick SSL Setup
Enable SSL with Let’s Encrypt:
Let’s Encrypt Certificates
Enable for Domain
Multiple Domains
Wildcard Certificate
Self-Signed Certificates
Generate Self-Signed
For Development
Custom Certificates
Install Custom Certificate
With Certificate Chain
Certificate Management
View Certificates
Check Expiration
Renew Certificates
Configuration
SSL settings in /etc/piglet/ssl.yml:
Next Steps
- Set up Custom Domain
- Learn about Security
6 - Domain
Learn how to set up custom domains for your Piglet Run services.
Overview
Configure custom domains for:
- Main Application: Your primary domain
- Subdomains: Service-specific subdomains
- Multiple Domains: Support multiple domains
Quick Setup
Add a custom domain:
DNS Configuration
Required DNS Records
Point your domain to Piglet Run:
| Type | Name | Value |
|---|---|---|
| A | @ | Your server IP |
| A | www | Your server IP |
| CNAME | code | @ |
| CNAME | jupyter | @ |
Using Cloudflare
Add Custom Domain
Primary Domain
Subdomain for Services
Domain Management
List Domains
Remove Domain
Set Primary
Configuration
Domain settings in /etc/piglet/domains.yml:
Verify Domain
Check domain configuration:
Next Steps
- Configure SSL for HTTPS
- Learn about Nginx Configuration
7 - Scale
Learn how to scale your Piglet Run resources up or down.
Overview
Piglet Run supports scaling:
- Database: Adjust PostgreSQL resources
- Storage: Expand disk capacity
- Services: Scale service resources
Quick Scale
Scale database resources:
Scale Database
Increase Resources
Adjust Connection Limits
Configure Shared Buffers
Scale Storage
Expand Disk
Add Storage Volume
Scale Services
VS Code Server
JupyterLab
Resource Limits
View current resource allocation:
Example output:
Configuration
Scale settings in /etc/piglet/resources.yml:
Best Practices
- Monitor resource usage before scaling
- Scale gradually to avoid disruption
- Test changes in development first
Next Steps
- Set up Monitoring
- Learn about Architecture
8 - Migrate
Learn how to migrate data from other systems to Piglet Run.
Overview
Piglet Run supports migration from:
- Other PostgreSQL: Migrate from existing PostgreSQL instances
- MySQL/MariaDB: Convert and migrate from MySQL
- Cloud Databases: AWS RDS, Google Cloud SQL, Azure Database
- Files: Import from SQL dumps or CSV files
Quick Migration
Migrate from another PostgreSQL:
Migrate from PostgreSQL
Direct Connection
From pg_dump File
Schema Only
Migrate from MySQL
Direct Migration
With Type Mapping
Migrate from Cloud
AWS RDS
Google Cloud SQL
Import Files
SQL Dump
CSV Files
Multiple CSV Files
Migration Options
| Option | Description |
|---|---|
--schema-only |
Migrate structure only |
--data-only |
Migrate data only |
--no-owner |
Skip ownership |
--parallel N |
Parallel jobs |
--exclude TABLE |
Exclude tables |
Verification
Verify migration:
Next Steps
- Learn about Backup
- Understand PostgreSQL Configuration
9 - Monitor
Learn how to set up alerts and monitoring for your Piglet Run instance.
Overview
Piglet Run includes comprehensive monitoring:
- Grafana Dashboards: Visual monitoring
- Alerting: Configurable alerts
- Metrics: Prometheus-based metrics
- Logs: Centralized logging
Quick Setup
Access monitoring dashboard:
Grafana Dashboards
Available Dashboards
| Dashboard | Description |
|---|---|
| Overview | System overview and health |
| PostgreSQL | Database performance metrics |
| Node | Server resource usage |
| Nginx | Web server statistics |
Access Dashboards
Set Up Alerts
Enable Email Alerts
Enable Slack Alerts
Enable Webhook Alerts
Alert Rules
View Alert Rules
Add Custom Alert
Default Alerts
| Alert | Condition | Severity |
|---|---|---|
| High CPU | > 80% for 5m | Warning |
| High Memory | > 90% for 5m | Warning |
| Disk Full | > 85% | Critical |
| DB Down | Connection failed | Critical |
| Replication Lag | > 1s | Warning |
Configuration
Alert configuration in /etc/piglet/alerts.yml:
View Logs
Next Steps
- Learn about Grafana
- Understand Architecture
10 - Upgrade
Learn how to upgrade your Piglet Run installation.
Overview
Piglet Run upgrades include:
- Minor Updates: Bug fixes and security patches
- Major Upgrades: New features and improvements
- PostgreSQL Upgrades: Database version upgrades
Quick Upgrade
Upgrade to latest version:
Check for Updates
View Current Version
Check Available Updates
Perform Upgrade
Standard Upgrade
Upgrade to Specific Version
Dry Run
Upgrade PostgreSQL
Check Compatible Versions
Upgrade Database Version
With Full Backup
Before Upgrading
-
Create Backup
-
Check Compatibility
-
Review Release Notes
Rollback
If upgrade fails:
Restore from Backup
Rollback to Previous Version
Upgrade History
View upgrade history:
Example output:
Configuration
Upgrade settings in /etc/piglet/upgrade.yml: