← Documentation

Getting Started

Setup, development workflow, and deployment guide

Setting Up a New Site

1

Create the directory structure

mkdir -p /home/mysite/{includes,assets/{css,js,icons},api,endpoints,help}
2

Copy shared assets

cp /home/test/includes/security.php /home/mysite/includes/
cp /home/test/includes/functions.php /home/mysite/includes/
cp -r /home/test/assets/css /home/mysite/assets/
cp -r /home/test/assets/js /home/mysite/assets/
3

Create index.php

<?php
require_once __DIR__ . '/includes/security.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Site</title>
    <link rel="stylesheet" href="/assets/css/app.css">
</head>
<body>
    <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">&#9789;</button>
    <div class="container">
        <h1>Welcome</h1>
    </div>
    <script src="/assets/js/app.js"></script>
</body>
</html>
4

Add Nginx vhost + SSL

See the Troubleshooting page for the full vhost template and SSL setup steps.

Nginx Vhost Template

server {
    listen 80;
    listen [::]:80;
    server_name mysite.kim8.s4s.host;
    return 301 https://mysite.kim8.s4s.host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name mysite.kim8.s4s.host;

    ssl_certificate /etc/letsencrypt/live/mysite.kim8.s4s.host/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mysite.kim8.s4s.host/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;

    root /home/mysite;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 300;
    }

    location ~ /\.(?!well-known) {
        deny all;
    }

    location /assets/ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}

Save to /etc/nginx/sites-available/mysite.kim8.s4s.host.conf, symlink, and reload:

ln -s /etc/nginx/sites-available/mysite.kim8.s4s.host.conf /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

SSL Setup with Certbot

# Install certbot (if not already)
apt install certbot python3-certbot-nginx

# Get certificate
certbot --nginx -d mysite.kim8.s4s.host

# Verify auto-renewal
certbot renew --dry-run

Certbot automatically adds SSL directives to your Nginx config and sets up a cron job for renewal.

PHP Requirements

PHP Version8.3.6 (FPM)
Required Extensionscurl, json, mbstring, openssl
PHP-FPM Socketunix:/run/php/php8.3-fpm.sock
Process Managerdynamic

Install PHP extensions

apt install php8.3-fpm php8.3-curl php8.3-mbstring php8.3-xml php8.3-mysql

Git Workflow

  1. Edit files directly in /home/mysite/ — changes are live immediately
  2. Track changes with git:
    cd /home/mysite
    git init
    git add .
    git commit -m "Initial setup"
  3. After making changes:
    git add .
    git commit -m "Description of changes"
  4. Update CHANGELOG.md and TODO.md as needed

Common Maintenance Tasks

Reload Nginx

nginx -t && systemctl reload nginx

Restart PHP-FPM

systemctl restart php8.3-fpm

Renew SSL

certbot renew

Check Disk Space

df -h

Check Service Status

systemctl status nginx php8.3-fpm mariadb

Clear PHP Session Files

find /tmp/sess_* -mtime +7 -delete 2>/dev/null

Sister Sites

test.kim8.s4s.hostMain hub, API reference, project docs
vision.kim8.s4s.hostVision AI, OCR, screenshot QA
featherless.kim8.s4s.hostModel catalog, text playground
generate.kim8.s4s.hostImage generation, upscaling
api.kim8.s4s.hostUnified API gateway (no auth needed)

Related Documentation