# Strapi Hosting: Deploy Your Headless CMS to the Cloud

· 3 min read
# Strapi Hosting: Deploy Your Headless CMS to the Cloud

**Primary keywords:** strapi hosting, deploy strapi, strapi cms hosting, headless cms hosting, strapi cloud deployment

---

Strapi is the leading open-source headless CMS built on Node.js.  deploy react app git pushApex Weave It auto-generates REST and GraphQL APIs from your content models, includes a rich admin panel, and supports multiple databases. Self-hosting Strapi gives you full control over your data and customization capabilities that hosted CMS platforms don't offer. This guide covers deploying Strapi to production cloud hosting.

## Why Self-Host Strapi?

cheap managed wordpress hosting Strapi's official cloud service works, but self-hosting on ApexWeave offers:

- **Cost control:** You pay for compute, not per-seat or per-content-request
- **Full customization:** Custom plugins, middlewares, and lifecycle hooks without limits
- **Data ownership:** Your database, your backups, your control
- **Integration flexibility:** Connect any database, any third-party service

## Strapi Production Requirements

Strapi needs specific configuration for production:

- `NODE_ENV=production` — changes internal behavior (disables admin creation without config)
- `APP_KEYS`, `API_TOKEN_SALT`, `ADMIN_JWT_SECRET`, `JWT_SECRET` — security keys
- `DATABASE_URL` — production database
- Admin panel assets must be built (`npm run build`)
- File uploads need a cloud storage provider (S3, Cloudinary) — local disk storage doesn't persist across deploys

## Project Configuration

### config/server.js

```javascript
module.exports = ( env ) => (
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
app:
keys: env.array('APP_KEYS'),
,
webhooks:
populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
,
);
```

### config/database.js

```javascript
module.exports = ( env ) =>
const client = env('DATABASE_CLIENT', 'postgres');

const connections =
postgres:
connection:
connectionString: env('DATABASE_URL'),
ssl: env.bool('DATABASE_SSL', false) ?  rejectUnauthorized: false  : false,
,
,
;

return
connection:
client,
...connections[client],
acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000),
,
;
;
```

### config/middlewares.js

```javascript
module.exports = [
'strapi::errors',

name: 'strapi::security',
config:
contentSecurityPolicy:
useDefaults: true,
directives:
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'https://your-s3-bucket.s3.amazonaws.com'],
'media-src': ["'self'", 'data:', 'blob:', 'https://your-s3-bucket.s3.amazonaws.com'],
upgradeInsecureRequests: null,
,
,
,
,
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
```

### package.json

```json

"scripts":
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build"


```

### Procfile

```
web: npm run build && npm start
```

Or if you want to separate build from start:

```
web: npm start
release: npm run build
```

## Deploying to ApexWeave

```bash
apexweave login

# Required security keys (generate with openssl rand -base64 32)
apexweave env:set APP_KEYS=$(openssl rand -base64 32),$(openssl rand -base64 32)
apexweave env:set API_TOKEN_SALT=$(openssl rand -base64 32)
apexweave env:set ADMIN_JWT_SECRET=$(openssl rand -base64 32)
apexweave env:set JWT_SECRET=$(openssl rand -base64 32)

# Database
apexweave env:set DATABASE_CLIENT=postgres
apexweave env:set DATABASE_URL=postgres://user:pass@host:5432/strapi_db
apexweave env:set DATABASE_SSL=true

# Application
apexweave env:set NODE_ENV=production
apexweave env:set HOST=0.0.0.0

apexweave deploy
```

## File Upload Configuration (AWS S3)

Local disk uploads won't work with cloud deployments — files would disappear on redeploy.  php app git deployment Use S3:

```bash
npm install @strapi/provider-upload-aws-s3
```

```javascript
// config/plugins.js
module.exports = ( env ) => (
upload:
config:
provider: 'aws-s3',
providerOptions:
s3Options:
region: env('AWS_REGION'),
params:
Bucket: env('AWS_BUCKET'),
,
,
,
actionOptions:
upload: ,
uploadStream: ,
delete: ,
,
,
,
);
```

```bash
apexweave env:set AWS_ACCESS_KEY_ID=your-key
apexweave env:set AWS_ACCESS_SECRET=your-secret
apexweave env:set AWS_REGION=us-east-1
apexweave env:set AWS_BUCKET=your-strapi-uploads
```

## Accessing the Admin Panel

After deployment, access the admin panel at `https://yourapp.apexweave.app/admin`. On first deployment, register the first admin user at `/admin/auth/register-admin`.

## Creating Content Types via API

Once deployed, use Strapi's Content-Type Builder in the admin, or create types programmatically:

```javascript
// src/api/article/content-types/article/schema.json

"kind": "collectionType",
"collectionName": "articles",
"info":
"singularName": "article",
"pluralName": "articles",
"displayName": "Article"
,
"attributes":
"title":  "type": "string", "required": true ,
"body":  "type": "richtext" ,
"slug":  "type": "uid", "targetField": "title" ,
"publishedAt":  "type": "datetime"



```

## Consuming the Strapi API

```typescript
// Your frontend consuming Strapi's API
const API = process.env.NEXT_PUBLIC_STRAPI_URL;

async function getArticles()
const res = await fetch(`$API/api/articles?populate=*`,
headers:
Authorization: `Bearer $process.env.STRAPI_API_TOKEN`,
,
);
return res.json();

```

## Streaming Logs

```bash
apexweave logs --follow
```

Strapi logs admin actions, API requests, and database queries here.

## SSH Access

```bash
apexweave ssh
# Check Strapi version
npx strapi version
# Run Strapi CLI commands
npx strapi console
```

## Custom Domain

```bash
apexweave domain:add cms.yourdomain.com
```

Update `APP_URL` if needed:

```bash
apexweave env:set URL=https://cms.yourdomain.com
```

## Plan Recommendations

Strapi's admin panel and content API require meaningful resources:

- **AppForge Starter ($5/mo):** Small Strapi instances, personal sites, prototypes
- **AppForge Pro ($10/mo):** Production Strapi with moderate content editors and API traffic
- **AppForge XL ($15/mo):** High-traffic Strapi APIs, large content teams, media-heavy CMS

## Your CMS, Your Data

Strapi's self-hosted model means your content, user data, and media files live where you control them. Pair it with ApexWeave's managed PostgreSQL hosting for a fully self-contained headless CMS stack.

Start your **free 7-day ApexWeave trial** today.  ApexWeave platform Deploy Strapi with `apexweave deploy` and have your headless CMS running on HTTPS in minutes. ApexWeave cloudfast wordpress cloud hosting