Skip to content

Websites & WebApps

Overview

A WebApp (website) in StarkOne is a self-contained hosting unit:

  • A Linux system user (/home/<username>/)
  • An nginx or Apache virtual host
  • A DNS zone (if PowerDNS is enabled)
  • An associated MySQL database (optional)
  • PHP-FPM pool with isolated settings

The terms "website" and "webapp" are interchangeable. The API uses /api/webapps/ (the older /api/websites/ prefix is automatically rewritten for backward compatibility).

Creating a Website

POST /api/webapps
Authorization: Bearer <token>
Content-Type: application/json

{
  "domain": "example.com",
  "username": "example",
  "php_version": "8.2"
}

Response:

{
  "data": {
    "id": 42,
    "domain": "example.com",
    "username": "example",
    "php_version": "8.2",
    "disk_usage": 0
  }
}

Requires websites_create permission.

Listing Websites

GET /api/webapps

Returns all websites the authenticated user has access to.

Getting a Website

GET /api/webapps/:id

Updating a Website

PATCH /api/webapps/:id
{
  "php_version": "8.3",
  "suspended": false
}

Requires websites_administration.

Deleting a Website

DELETE /api/webapps/:id

Removes the system user, home directory, vhost, DNS zone, and database records. Irreversible.

Changing the Domain

POST /api/webapps/:id/change-domain
{
  "domain": "newdomain.com"
}

Rewrites the nginx/apache vhost and DNS zone.

Domain Aliases

Add multiple domains pointing to the same website:

# List aliases
GET /api/webapps/:id/aliases

# Add alias
POST /api/webapps/:id/aliases
{ "alias": "www.example.com" }

# Remove alias
DELETE /api/webapps/:id/aliases/:alias

Duplicating a Website

POST /api/webapps/:id/duplicate
{
  "new_domain": "copy.example.com",
  "new_username": "copy_example"
}

Copies files, databases, and configuration.

WordPress

StarkOne detects WordPress installations automatically via wp-config.php.

WordPress Auto-Login

POST /api/webapps/:id/wp-autologin

Returns a one-time login URL to the WordPress admin dashboard without requiring a password.

Quick Install

POST /api/webapps/:id/install/wordpress
{
  "db_name": "wp_example",
  "db_user": "wp_user",
  "db_password": "secret",
  "wp_admin": "admin",
  "wp_password": "admin_secret",
  "wp_email": "[email protected]"
}

Nextcloud

Quick install and auto-login:

POST /api/webapps/:id/install/nextcloud
POST /api/webapps/:id/nextcloud-autologin

SSL / Let's Encrypt

# Check SSL status
GET /api/webapps/:id/ssl/status

# Issue Let's Encrypt certificate
POST /api/webapps/:id/ssl/issue
{
  "email": "[email protected]"
}

SSH Keys (Authorized Keys)

# List SSH keys
GET /api/webapps/:id/ssh-keys

# Add SSH key
POST /api/webapps/:id/ssh-keys
{ "key": "ssh-rsa AAAA...", "comment": "my laptop" }

# Delete SSH key
DELETE /api/webapps/ssh-keys/:keyid

Private Keys

Generate and manage private keys for outgoing SSH connections:

GET /api/webapps/:id/ssh-private-keys
POST /api/webapps/:id/ssh-private-keys
{ "name": "deploy-key", "type": "ed25519" }

DELETE /api/webapps/:id/ssh-private-keys/:name
GET /api/webapps/:id/ssh-private-keys/:name/download

Cron Jobs

# List cron entries
GET /api/webapps/:id/crontab

# Add cron entry
POST /api/webapps/:id/crontab
{
  "schedule": "0 * * * *",
  "command": "php /home/example/public_html/cron.php"
}

# Update cron entry
PUT /api/webapps/:id/crontab/:index
{ "schedule": "*/5 * * * *", "command": "..." }

# Delete cron entry
DELETE /api/webapps/:id/crontab/:index

Backups (Duplicity)

# List backups
GET /api/webapps/:id/backups

# Create backup
POST /api/webapps/:id/backups

# Get backup progress
GET /api/webapps/:id/backups/progress

# Restore from backup
POST /api/webapps/:id/backups/restore
{ "date": "2024-01-15T10:00:00Z" }

Nginx ↔ Apache Hot-Swap

Switch the web server for the entire panel:

POST /api/settings/webserver/switch
{
  "webserver": "apache"   # or "nginx"
}

Rewrites all vhosts and restarts the web server. Requires superuser.

Website Stats

GET /api/webapps/:id/stats
GET /api/webapps/:id/analytics   # GoAccess real-time analytics

Detected Applications

GET /api/webapps/:id/detected-apps

Returns detected applications (WordPress, Nextcloud, etc.) with version info.

Custom Nginx Configuration

# Get custom nginx config for a website
GET /api/webapps/:id/cust-nginx

# Save custom nginx config
POST /api/webapps/:id/cust-nginx
{ "config": "location /api/ { ... }" }

Performance Settings

GET /api/webapps/:id/performance
POST /api/webapps/:id/performance
{
  "php_max_children": 10,
  "php_start_servers": 2
}

Resource Limits

GET /api/webapps/:id/limits
POST /api/webapps/:id/limits
{
  "cpu_limit": 50,
  "memory_limit": 512,
  "io_limit": 100
}
DELETE /api/webapps/:id/limits

Requires administrative_operations.

FTP Accounts

FTP accounts require the FTP plugin (vsftpd/pure-ftpd).

GET /api/ftp/webapps/:id/accounts
POST /api/ftp/webapps/:id/accounts
{ "username": "ftpuser", "password": "secret", "path": "/" }
DELETE /api/ftp/accounts/:id
PATCH /api/ftp/accounts/:id