Based on a tutorial by PR from Vultr
Struggling to maintain full control over your content while still creating engaging web applications? You’re not alone. Many content creators face the challenge of balancing ownership with sophisticated content delivery.
In this article, I’ve summarized a comprehensive tutorial that demonstrates how to use Coolify and Strapi on Vultr to create self-hosted content applications that give you complete freedom over your content distribution.
Quick Navigation
Introduction to Self-Hosted Content (00:00-05:30)
Self-hosted content is the practice of distributing and publishing your own content on your own terms. This approach gives you complete control and ownership over everything you create.
Key Points:
- Self-hosted content enables full control and ownership of your published materials
- You can make continuous updates and upgrades based on your specific needs
- Content can be distributed through multiple channels at your discretion
The tutorial introduces two powerful tools that make self-hosting content applications easier:
Coolify
Coolify is an open-source self-hosted deployment platform that allows you to deploy multiple applications on your server without handling dependency or configuration packages manually.
Coolify Features:
- Supports Docker and other containerization platforms
- Enables one-click deployment of applications and services
- Integrates with external services like databases, CDNs, and object storage
Strapi
Strapi is an open-source headless CMS that supports RESTful and GraphQL APIs to host and publish your content across various target platforms.
Strapi Features:
- Integrates with front-end frameworks like React and Hugo
- Highly extensible with plugins and collection types
- Uses a modern web administration panel for content management
My Take:
The combination of Coolify and Strapi creates a powerful self-hosted solution that eliminates the need for third-party content platforms. This gives you unprecedented flexibility in how you create, manage, and distribute your content.
Setting Up Coolify and Strapi on Vultr (05:31-12:45)
The demonstration shows how to deploy both Coolify and Strapi using Vultr Marketplace applications. This streamlined approach makes setup much easier than manual installation.
Deployment Steps:
- Log into the Vultr customer portal
- Click on “Compute” and then “Deploy”
- Select “Marketplace Apps” and choose either Coolify or Strapi
- For optimal performance, select a server with 4 vCPUs and 16GB RAM
- Set up a hostname for each server (e.g., “tech-coolify” and “tech-strapi”)
- Click “Deploy” to create the instances
After deployment, you’ll need to create administrator accounts for both platforms:
Setting up Administrator Accounts
For both Coolify and Strapi, you’ll be prompted to create an administrator account when accessing them for the first time through their respective web interfaces.
My Take:
Using Vultr’s Marketplace applications saves significant time compared to manual installation. The one-click deployment ensures you have properly configured instances with all dependencies pre-installed.
Configuring Coolify for React Application Deployment (12:46-18:30)
The tutorial demonstrates how to deploy a React application to Coolify using a GitHub repository. This creates the front-end that will consume content from Strapi.
Deployment Process:
- Push your React application to a GitHub repository (public or private)
- In Coolify, select “Public Repository” or “Private Registry” based on your repo type
- Enter your repository URL and click “Check Repository”
- Coolify will automatically detect your application type and port (React apps typically use port 3000)
Configuring the Deployment
After Coolify detects your application, you’ll need to configure how it builds and runs:
Configuration Steps:
- Set the build command to “npm run build”
- Set the start command to “npm start”
- Use Coolify-generated labels by clicking “Reset to Coolify generated labels”
- Click “Save” and then “Deploy” to start the deployment process
You can monitor the deployment through the logs. Once successful, Coolify provides a link to access your application.
My Take:
Coolify dramatically simplifies the deployment process by handling all the build steps and environment configuration automatically. This lets you focus on developing your application rather than managing deployment infrastructure.
Creating Content Types in Strapi (18:31-22:15)
The tutorial shows how to set up collection types in Strapi that will house your content and make it available through APIs for your React application.
Setting up Collection Types:
- Click “Create your first content type” in Strapi
- Create a new collection type (e.g., “Article”)
- Note the API ID as you’ll need this to access the published data
Adding Fields to Collection Types
The collection type needs fields that match what your React application expects:
Field Configuration:
- Add a “Title” text field
- Add a “Sample” text field for description
- Add an “IMG” media field for images
- Save the collection type configuration
After saving, Strapi will restart to apply the changes to your collection type.
// Example React component that consumes Strapi data
import React from 'react';
const ArticleCard = ({ article }) => {
return (
<div className="article-card">
<h3>{article.title}</h3>
<p>{article.sample}</p>
<img
src={article.IMG.formats.thumbnail.url}
alt={article.title}
/>
</div>
);
};
export default ArticleCard;
My Take:
The field names in Strapi must exactly match what your front-end application expects. Plan your content structure carefully before setting up your collection types to avoid having to make changes later.
Publishing Content and API Integration (22:16-27:40)
The final section demonstrates how to create and publish content in Strapi and configure API permissions so your React application can access it.
Creating Content:
- Navigate to “Content Manager” in Strapi
- Click “Create new entry”
- Fill in the fields (Title, Sample text, and select an image)
- Save and then Publish the content
Setting Up API Permissions
By default, Strapi restricts API access. You need to configure permissions to allow your application to read the content:
Permission Configuration:
- Go to “Settings” > “Roles”
- Click on “Public” role
- Find your collection type (e.g., “Article”)
- Enable “find” and “findOne” permissions
- Save the role configuration
After configuring permissions, your React application can access the API endpoint to fetch and display content from Strapi.
API Response Structure:
- Content includes all fields you defined (title, sample, etc.)
- Images are available in multiple formats (thumbnail, small, medium, large)
- You can choose which image format to use in your application
My Take:
The separation between content (Strapi) and presentation (React) gives you incredible flexibility. You can completely redesign your front-end without touching your content structure, or expand your content model without breaking your existing applications.
This article summarizes the excellent tutorial created by PR from Vultr. If you found this summary helpful, please support the creator by watching the full video and subscribing to their channel.