Deploy and Host Strapi on Sealos
Strapi is the leading open-source headless CMS, built with 100% JavaScript/TypeScript and fully customizable. This template provides one-click deployment of a production-ready Strapi instance with PostgreSQL database backend, enabling you to build powerful content management systems and APIs with minimal setup on Sealos Cloud.
About Hosting Strapi
Strapi runs as a Node.js application that provides both a powerful admin panel for content management and RESTful/GraphQL APIs for content delivery. The headless architecture separates content management from presentation, allowing you to use Strapi as a backend for websites, mobile apps, IoT devices, or any other platform that consumes content via APIs.
The Sealos template automatically provisions a PostgreSQL database for persistent content storage, configures all necessary environment variables including security tokens, and sets up persistent storage for uploaded media files and application data. The deployment includes an init container that handles the initial build process, ensuring your Strapi admin panel is ready to use immediately after deployment.
Common Use Cases
- Headless CMS for Websites: Power modern JAMstack websites with a flexible content backend
- Mobile App Backend: Provide content APIs for iOS, Android, and cross-platform mobile applications
- Multi-Channel Content Delivery: Manage content once and deliver it across web, mobile, IoT, and other platforms
- Custom API Development: Build RESTful or GraphQL APIs with a visual content type builder
- E-commerce Product Management: Manage product catalogs, descriptions, and media assets
- Blog and Publication Platforms: Create content-rich publishing systems with custom workflows
- Internal Tools and Dashboards: Build admin panels and internal applications with rapid development
Dependencies for Strapi Hosting
The Sealos template includes all required components: Strapi application server and PostgreSQL database with automatic initialization.
Deployment Dependencies
Implementation Details
Architecture Components
This template deploys two interconnected services:
Resource Allocation:
| Component | CPU Request | CPU Limit | Memory Request | Memory Limit |
|---|
| Strapi (Runtime) | 100m | 1000m | 25Mi | 256Mi |
| Strapi (Init Build) | 200m | 2000m | 307Mi | 3072Mi |
| PostgreSQL | 50m | 500m | 51Mi | 512Mi |
Environment Configuration
The template automatically configures Strapi with the following settings:
Database Configuration:
- Client: PostgreSQL
- Connection: Automatic via Kubernetes secrets
- Database name:
strapi
- SSL: Disabled (internal cluster communication)
Security Tokens:
All security tokens are automatically generated with cryptographically secure random values:
- JWT Secret: 32-character random string
- Admin JWT Secret: 32-character random string
- App Keys: 4 x 32-character random strings
- API Token Salt: 32-character random string
- Transfer Token Salt: 32-character random string
Public URLs:
- Admin URL:
https://<app-host>.<domain>/admin
- Public URL:
https://<app-host>.<domain>
- CORS: Configured for your deployment domain
Deployment Process
The deployment includes a two-stage initialization:
- Database Initialization Job: Creates the
strapi database in PostgreSQL
- Application Init Container: Builds the Strapi admin panel before the main container starts
- Main Container: Runs Strapi in production or development mode
This ensures your Strapi instance is fully ready to use immediately after deployment completes.
Why Deploy Strapi on Sealos?
Sealos is an AI-assisted Cloud Operating System built on Kubernetes that unifies the entire application lifecycle, from development in cloud IDEs to production deployment and management. By deploying Strapi on Sealos, you get:
- One-Click Deployment: Deploy a complete Strapi CMS with PostgreSQL database in seconds. No complex configuration or Kubernetes expertise required.
- Pre-Configured Database: PostgreSQL is automatically provisioned, initialized, and connected to Strapi with secure credentials.
- Automatic Build Process: The init container handles the Strapi admin panel build, so you can start creating content immediately.
- Persistent Storage: Built-in persistent storage ensures your content, media uploads, and configuration survive restarts and updates.
- Secure Public Access: Strapi gets automatic public URL with SSL certificate, allowing secure access to both admin panel and APIs.
- Environment Flexibility: Choose between production and development modes to match your workflow.
- Easy Scaling: Adjust resources through intuitive forms as your content and traffic grow.
- Automatic Security: All security tokens are generated automatically with cryptographically secure random values.
Deploy Strapi on Sealos and focus on building great content experiences instead of managing infrastructure.
Deployment Guide
- Visit Strapi Template Page
- Click the "Deploy Now" button
- Select your Node environment mode:
- Production (recommended): Optimized for performance and stability
- Development: Enables hot-reload and development features
- Wait for deployment to complete (typically 2-3 minutes, including build process)
- Access Strapi via the provided URL (shown in the canvas)
- Create your admin account on first access to the admin panel
Configuration
After deployment, you can customize your Strapi instance:
Initial Setup
- Create Admin Account: On first access to
/admin, you'll be prompted to create an administrator account
- Configure Content Types: Use the Content-Type Builder to define your data models
- Set Permissions: Configure role-based access control for API endpoints
- Upload Media: Use the Media Library to manage images, videos, and other assets
Resource Scaling
Adjust resources in the canvas based on your needs:
- CPU/Memory: Increase for better performance with high traffic or complex content types
- Storage: Expand application storage for more media uploads and content
API Configuration
Strapi provides both REST and GraphQL APIs:
- REST API:
https://<app-host>.<domain>/api
- GraphQL API:
https://<app-host>.<domain>/graphql (requires GraphQL plugin)
Service Endpoints
| Service | Endpoint | Purpose |
|---|
| Admin Panel | https://<app-host>.<domain>/admin | Content management interface |
| REST API | https://<app-host>.<domain>/api | RESTful API endpoints |
| GraphQL | https://<app-host>.<domain>/graphql | GraphQL API (if enabled) |
| PostgreSQL | <app-name>-pg-postgresql.<namespace>.svc:5432 | Database (internal) |
Troubleshooting
Common Issues
Issue 1: Admin Panel Not Loading
- Cause: Build process may still be running or failed
- Solution: Check the init container logs in the Terminal. The build process can take 1-2 minutes on first deployment. If the build failed, check resource limits and try redeploying.
Issue 2: Database Connection Errors
- Cause: PostgreSQL not ready or connection credentials incorrect
- Solution: Verify the PostgreSQL cluster is running in the canvas. Check that the
strapi database was created by examining the init job logs. The connection is automatic via Kubernetes secrets.
Issue 3: Media Upload Failures
- Cause: Storage full or permission issues
- Solution: Increase the application storage allocation in the canvas. Default is 2Gi for application data.
Issue 4: API Endpoints Return 403 Forbidden
- Cause: Permissions not configured for public access
- Solution: In the Strapi admin panel, go to Settings → Roles → Public, and enable permissions for the endpoints you want to expose publicly.
Issue 5: Slow Performance
- Cause: Insufficient resources for your content volume
- Solution: Increase CPU and memory allocation in the canvas. Consider upgrading from the default 1000m CPU / 256Mi memory limits.
Getting Help
Additional Resources
Development Workflow
Connecting Your Frontend
To connect your frontend application to Strapi APIs:
// Example: Fetching content from Strapi REST API
const response = await fetch('https://<app-host>.<domain>/api/articles?populate=*', {
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
});
const data = await response.json();
Creating API Tokens
- Go to Settings → API Tokens in the admin panel
- Click "Create new API Token"
- Set token name, type (Read-only, Full access, Custom), and duration
- Copy the generated token (shown only once)
- Use the token in your application's API requests
Custom Development
For custom plugin development or extending Strapi:
- Switch to development mode by updating the
node_env input to development
- Access the application storage via the canvas to modify code
- Changes will hot-reload automatically in development mode
- Switch back to production mode for optimal performance
License
This Sealos template is provided under MIT License. Strapi is provided under its own license - see Strapi License for details.