Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ jobs:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Install test tools
run: sudo apt-get install -y shellcheck gettext-base

- name: Run unit tests
run: bash tests/run.sh unit --verbose

- name: Run static tests
run: bash tests/run.sh static --verbose

- name: Verify Plunk gateway routing across address changes
run: bash tests/e2e/plunk-gateway.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ tests/e2e/results/

# Superpowers — specs, plans, working notes. Local only, never committed.
docs/superpowers/

# Private task tracking (never committed)
priv/
22 changes: 5 additions & 17 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local/ -> User scripts (deploy, backup, setup)
apps/<app>/ -> App installers (install.sh + README.md)
lib/ -> Helper libraries (cli-parser, db-setup, domain-setup, server-exec, port-utils)
lib/providers/ -> Provider plugins (mikrus/, generic hooks via detect.sh)
locale/ -> i18n language files (en.sh, pl.sh) — 1325 MSG_* keys each
locale/ -> i18n language files (en.sh, pl.sh)
system/ -> System scripts (docker, caddy, backup-core)
installers/ -> Template + build.sh for stackpilot.techskills.academy/<app> oneliner endpoints
tests/ -> Test suites (unit/, static/, e2e/)
Expand Down Expand Up @@ -67,7 +67,7 @@ Provider-specific code lives in `lib/providers/<provider>/`. Detection is in `li

```bash
./tests/run.sh # unit + static (default)
./tests/run.sh unit # 66 unit tests
./tests/run.sh unit # unit tests
./tests/run.sh static # shellcheck, install contract, compose syntax, locale coverage
./tests/run.sh e2e --ssh=HOST # E2E integration tests on a real server
```
Expand Down Expand Up @@ -310,19 +310,19 @@ On the server, the helper is `sp-redirect add|remove|list <domain> [<path> [<tar

Per-domain configuration lives in `/etc/caddy/conf.d/<domain>.caddy`. The main `/etc/caddy/Caddyfile` only contains `import /etc/caddy/conf.d/*.caddy`. Each call to `add-static-hosting.sh`, `add-php-hosting.sh`, or `add-redirect.sh` updates exactly one file in `conf.d/`.

## Applications (37)
## Applications

All located in `apps/<name>/install.sh`. Run via `deploy.sh`, not directly.

affine, cap, captions-cli, convertx, cookie-hub, coolify, countdown-timer, crawl4ai, dockge, filebrowser, gotenberg, immich, keila, linkstack, listmonk, littlelink, mailstack, mcp-docker, minio, n8n, nocodb, ntfy, picoclaw, postiz, poststack, redis, routepix, sellf, sgtm, social-media-generator, stirling-pdf, supabase, typebot, umami, uptime-kuma, vaultwarden, watchtower, wordpress
affine, cap, captions-cli, convertx, cookie-hub, coolify, countdown-timer, crawl4ai, dockge, filebrowser, gotenberg, immich, keila, ksef-gateway, linkstack, listmonk, littlelink, mailcheap, mailstack, mcp-docker, minio, n8n, nocodb, notifuse, ntfy, picoclaw, plunk, postiz, poststack, redis, routepix, sellf, sgtm, social-media-generator, stirling-pdf, supabase, typebot, umami, uptime-kuma, vaultwarden, watchtower, wordpress

Plus static site hosting (Astro, Next.js static export, Hugo, Eleventy, SvelteKit, Gatsby, Docusaurus, VitePress, MkDocs) via `local/deploy-static.sh` — see GUIDE.md.

Details for a specific app (ports, requirements, DB) -> `apps/<app>/README.md` or `GUIDE.md`

### Coolify (special flow)

Coolify is a full PaaS (private Heroku) -- **only for servers with 8GB+ RAM and 80GB+ disk**.
Coolify is a full PaaS (private Heroku) -- **only for servers with 4GB+ RAM (enforced by the installer); 8GB RAM and 80GB disk recommended**.
Does not use `DOMAIN_TYPE`, `DB_*`, or `/opt/stacks/`. Delegates to the official Coolify installer (`curl | bash`), which installs Docker, Traefik, PostgreSQL, Redis and creates `/data/coolify/`.
Takes over ports 80/443 -- **do not mix with other toolbox apps.**

Expand Down Expand Up @@ -435,15 +435,3 @@ Detailed documentation -> **`GUIDE.md`** (operational reference):
Other sources:
- `apps/<app>/README.md` - per-application details
- `docs/CLI-REFERENCE.md` - full CLI parameter reference

## Active Refactor

**STATUS:** The refactor plan in `REFACTOR-PLAN.md` tracks the merge of mikrus-toolbox into stackpilot.

**Completed:** Phase 1 (i18n), Phase 2 (providers), Phase 3 (unit tests), Phase 4 (static validation), Phase 6 (test runner + CI).
**Remaining:** Phase 5 (E2E integration tests), Phase 7 (finalization — archive mikrus-toolbox, production test on Mikrus).

At the start of every session involving this project, READ `REFACTOR-PLAN.md` first to:
1. Check current progress (look for `- [x]` vs `- [ ]`)
2. Continue from the first uncompleted task
3. Update checkboxes as work is completed
6 changes: 5 additions & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ Applications are located in `apps/<name>/install.sh`:
| **nocodb** | Database (alt. Airtable) | PostgreSQL | 8080 |
| **listmonk** | Newsletter and mailing | PostgreSQL* | 9000 |
| **mailstack** | Forms and transactional email (profiles a/b/c, see its README) | SQLite or D1 | none (Tunnel) |
| **plunk** | Transactional and marketing email (AWS SES) | Bundled PostgreSQL + Redis + MinIO | 3560 |
| **mailcheap** | Newsletters and API/MCP (local image build required) | Bundled MongoDB | 3000 |
| **notifuse** | Email marketing and transactional email | Bundled PostgreSQL 17 | 8081 |
| **keila** | Email marketing (alt. Mailchimp/Brevo) | PostgreSQL | 4500 |
| **typebot** | Chatbot builder | PostgreSQL* | 8081/8082 |
| **affine** | Knowledge base (alt. Notion/Miro) | PostgreSQL | 3010 |
Expand All @@ -118,8 +121,9 @@ Applications are located in `apps/<name>/install.sh`:
| **routepix** | Visualize travel routes from geotagged photos | - | 3000 |
| **immich** | Self-hosted photo/video library (alt. Google Photos) | PostgreSQL | 2283 |
| **supabase** | Self-hosted PostgreSQL + Auth + Storage + Studio | PostgreSQL | 54321 |
| **coolify** | Full PaaS with 280+ one-click apps (requires 8GB+ RAM) | PostgreSQL | 8000 |
| **coolify** | Full PaaS with 280+ one-click apps (requires 4GB+ RAM, 8GB recommended) | PostgreSQL | 8000 |
| **countdown-timer** | Animated countdown GIF generator for emails/web (PHP) | - | 8086 |
| **ksef-gateway** | REST API for Poland's KSeF e-invoicing system | - | 8080 |

*PostgreSQL with an asterisk requires `gen_random_uuid()` (PG 13+). Applies to: n8n, umami, listmonk, typebot, postiz, affine. Use `bundled` or a dedicated database (PG 13+).

Expand Down
43 changes: 27 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# StackPilot

**The AI-native self-hosting toolkit. Deploy 36+ production-optimized apps plus static sites (Astro, Next.js, Hugo, Eleventy, …) to any VPS — or to Cloudflare Pages — with a single command.**
**The AI-native self-hosting toolkit. Deploy 40+ production-optimized apps plus static sites (Astro, Next.js, Hugo, Eleventy, …) to any VPS — or to Cloudflare Pages — with a single command.**

![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)
![Apps: 36+](https://img.shields.io/badge/Apps-36%2B-blue)
![Apps: 40+](https://img.shields.io/badge/Apps-40%2B-blue)
![Any VPS](https://img.shields.io/badge/Platform-Any%20VPS-orange)
[![GitHub Stars](https://img.shields.io/github/stars/jurczykpawel/stackpilot?style=social)](https://github.com/jurczykpawel/stackpilot)

Expand All @@ -26,7 +26,7 @@ cd stackpilot
- **One command, production-ready**: Each app is deployed with a single `deploy.sh` call. Memory limits, log rotation, health checks, security headers, and database provisioning are handled automatically.
- **Zero platform overhead**: No web dashboard to maintain, no background services eating RAM. Just Bash scripts, SSH, and Docker. Your server resources go to your apps, not the platform.
- **Database flexibility**: Bundled containers (auto-provisioned, zero config) or external databases. WordPress also supports SQLite. Your choice, per app.
- **36+ curated apps**: Not a marketplace of untested community templates. Every app config is tuned and tested for small VPS environments (512MB--2GB RAM).
- **40+ curated apps**: Not a marketplace of untested community templates. Every app config is tuned and tested for small VPS environments (512MB--2GB RAM).

---

Expand Down Expand Up @@ -86,6 +86,9 @@ cd stackpilot
| :--- | :--- | :--- |
| [Listmonk](apps/listmonk/) | Mailchimp | High-performance newsletter and mailing list manager. |
| [Mailstack](apps/mailstack/) | Web3Forms | Forms and transactional email with an encrypted delivery log; Pro panel and webhooks, on Cloudflare Workers or your server (`--plan=`). |
| [Plunk](apps/plunk/) | SendGrid / Resend | Transactional and marketing email on AWS SES; bundled PostgreSQL, Redis and storage. |
| [MailCheap](apps/mailcheap/) | Mailchimp / beehiiv | Newsletter platform with API/MCP; locally built image and bundled MongoDB. |
| [Notifuse](apps/notifuse/) | Mailchimp / Brevo | Email marketing and transactional email with bundled PostgreSQL. |
| [Keila](apps/keila/) | Mailchimp / Brevo | Email marketing platform. Campaigns, newsletters, subscriber management. |
| [Typebot](apps/typebot/) | Typeform | Conversational forms and chatbots. Lead capture, surveys. |
| [Postiz](apps/postiz/) | Buffer / Hootsuite | Schedule posts to X, LinkedIn, Instagram, Facebook, TikTok. |
Expand Down Expand Up @@ -127,17 +130,16 @@ cd stackpilot
| [Supabase](apps/supabase/) | Firebase / Neon | Self-hosted PostgreSQL + Auth + Storage + Realtime + Studio. |
| [MCP Docker](apps/mcp-docker/) | - | Let AI assistants manage Docker containers on your server. |
| [sGTM](apps/sgtm/) | - | Server-side Google Tag Manager. 1st-party analytics, reliable tracking without ad blockers. |
| [KSeF Gateway](apps/ksef-gateway/) | - | REST API for Poland's national e-invoicing system (KSeF): send and receive invoices, PDFs with a verification QR code. |
| [Countdown Timer](apps/countdown-timer/) | - | Animated countdown GIF generator for emails and landing pages. (PHP, no Docker) |
| [Coolify](apps/coolify/) | Heroku / Vercel / Netlify | Self-hostable PaaS — deploy apps, databases, and services from Git. Requires 8GB+ RAM (takes over ports 80/443). |
| [Coolify](apps/coolify/) | Heroku / Vercel / Netlify | Self-hostable PaaS — deploy apps, databases, and services from Git. Requires 4GB+ RAM, 8GB recommended (takes over ports 80/443). |

### AI and Data

| App | Replaces | Description |
| :--- | :--- | :--- |
| [PicoClaw](apps/picoclaw/) | OpenClaw | Ultra-lightweight AI assistant (Telegram/Discord/Slack). ~10MB image, 64MB RAM. Security-hardened. |
| [Crawl4AI](apps/crawl4ai/) | Firecrawl | Web crawler that turns sites into clean Markdown for LLMs and RAG pipelines. |
| [Crawl4AI](apps/crawl4ai/) | ScrapingBee | AI web scraper with REST API. Markdown output, JS rendering. |
| [Coolify](apps/coolify/) | Heroku / Vercel | Full PaaS with 280+ one-click apps. Requires 8GB+ RAM. |

> Every app has its own `README.md` with detailed docs, requirements, and configuration options.

Expand Down Expand Up @@ -422,7 +424,7 @@ Any provider that gives you a Linux VPS with SSH access: Hetzner, DigitalOcean,
Yes. Static sites hosted on Mikrus (a $5/month Polish VPS) behind Cloudflare CDN can achieve perfect Lighthouse scores (Performance, Accessibility, Best Practices, SEO — all 100). The key is proper development: defer non-critical resources (fonts, analytics) after `window.load`, avoid CPU-intensive CSS like SVG `feTurbulence`, inline small assets as base64 to eliminate LCP from external network requests, and use `font-display: optional` to prevent font-swap LCP spikes.

**How much RAM do I need?**
512MB handles Caddy + 1 lightweight app. 1GB runs n8n + 2--3 smaller services comfortably. 2GB supports a full stack of 10+ apps. Coolify requires 8GB+.
512MB handles Caddy + 1 lightweight app. 1GB runs n8n + 2--3 smaller services comfortably. 2GB supports a full stack of 10+ apps. Coolify requires 4GB+ (8GB recommended).

**How do databases work?**
Apps that need PostgreSQL or MySQL can use a bundled database container (auto-provisioned, zero config) or connect to an external database you provide. WordPress also supports SQLite for simple sites.
Expand All @@ -437,15 +439,15 @@ Run `deploy.sh` again. The script detects existing installations and pulls the l
Yes. Add your own `apps/<name>/install.sh` installer (see GUIDE.md) -- you are not limited to the built-in apps.

**How is this different from Coolify?**
Coolify is a full PaaS platform (like a self-hosted Heroku) with a web dashboard, built-in Traefik, and its own PostgreSQL/Redis. It is powerful but heavyweight. StackPilot is minimal: Bash scripts + SSH + Docker. No platform overhead, no web UI to maintain. Note: Coolify itself can be deployed *via* StackPilot on servers with 8GB+ RAM.
Coolify is a full PaaS platform (like a self-hosted Heroku) with a web dashboard, built-in Traefik, and its own PostgreSQL/Redis. It is powerful but heavyweight. StackPilot is minimal: Bash scripts + SSH + Docker. No platform overhead, no web UI to maintain. Note: Coolify itself can be deployed *via* StackPilot on servers with 4GB+ RAM (8GB recommended).

---

## Roadmap

### Completed

- [x] 36+ production-optimized app deployments
- [x] 40+ production-optimized app deployments
- [x] CLI deploy with interactive prompts
- [x] Caddy auto-HTTPS and Cloudflare DNS integration
- [x] Bundled database provisioning (PostgreSQL, MySQL, SQLite)
Expand Down Expand Up @@ -550,23 +552,30 @@ StackPilot includes a comprehensive test suite:
./tests/run.sh e2e --ssh=your-vps --suite=deploy-no-db
./tests/run.sh e2e --ssh=your-vps --app=ntfy

# Email apps: fresh deployment, HTTP and database persistence across restart
./tests/run.sh e2e --ssh=your-vps --suite=email-apps
# Optional public HTTPS checks through the existing Cloudflare/Caddy flow
./tests/run.sh e2e --ssh=your-vps --suite=email-apps \
--domain-type=cloudflare --domain-suffix=sp-test.example.com

# Run everything
./tests/run.sh all --ssh=your-vps
```

| Suite | Tests | Runtime | What it checks |
| :--- | :--- | :--- | :--- |
| Unit | 67 | <1s | CLI parser, i18n, DB setup, domain setup, ports, resources, providers |
| Static | 4 | ~8s | ShellCheck (95 files), install.sh contract, compose syntax, locale coverage |
| E2E (quick) | ~15 | ~15min | Core apps on a real server: deploy, health, cleanup |
| E2E (full) | ~37 | ~45-60min | All 37 apps — auto-skips apps that exceed server resources |
| Suite | What it checks |
| :--- | :--- |
| Unit | CLI parser, i18n, database/domain setup, ports, resources, providers, installer configuration and runner behavior |
| Static | ShellCheck, installer contract, generated Compose syntax and locale coverage |
| E2E (quick/full) | Real-server deployment, health and cleanup across the selected application suites |
| E2E `email-apps` | Fresh deployment, HTTP health and console, optional public HTTPS, database persistence and unchanged credentials across restart |

**E2E suites:**

| Suite | Apps tested | Requirement |
| :--- | :--- | :--- |
| `deploy-no-db` | ntfy, uptime-kuma, filebrowser, minio, gotenberg, linkstack | SSH access |
| `deploy-postgres` | umami, nocodb, listmonk, n8n, typebot, affine, postiz | SSH access |
| `email-apps` | plunk, mailcheap, notifuse; HTTP and DB persistence | Fresh stack names; Plunk SES bootstrap config and prebuilt MailCheap image; optional Cloudflare credentials |
| `deploy-mysql` | wordpress | SSH access |
| `deploy-tcp` | redis, mcp-docker | SSH access |
| `domain-cloudflare` | ntfy, littlelink, cookie-hub | Cloudflare API token |
Expand All @@ -582,6 +591,8 @@ StackPilot includes a comprehensive test suite:

Apps that require more RAM/disk than the server has are automatically **skipped** (not failed). On a 1GB VPS the heavy apps (typebot, affine, postiz, crawl4ai) skip; on a 2-4GB VPS they run.

The `email-apps` suite refuses existing stacks and cleans only resources it created. Public test names are `<app>-<domain-suffix>` (for example `notifuse-sp-test.example.com`). It does not send emails; complete provider setup and delivery checks separately before using campaigns. See each app README for prerequisites.

CI runs unit + static tests on every push and PR. E2E tests run nightly or on-demand.

---
Expand Down Expand Up @@ -654,6 +665,6 @@ MIT -- see [LICENSE](LICENSE) for details.

---

*Self-hosted infrastructure toolkit. Deploy 36+ open-source apps (n8n, WordPress, Listmonk, Typebot, NocoDB, Vaultwarden, and more) to any VPS with one command. Replace $300+/month in SaaS subscriptions with a $5/month server.*
*Self-hosted infrastructure toolkit. Deploy 40+ open-source apps (n8n, WordPress, Listmonk, Typebot, NocoDB, Vaultwarden, and more) to any VPS with one command. Replace $300+/month in SaaS subscriptions with a $5/month server.*

![](https://stats.techskills.academy/pixels/github?url=/readme/stackpilot)
26 changes: 17 additions & 9 deletions apps/listmonk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
set -e

APP_NAME="listmonk"
STACK_DIR="/opt/stacks/$APP_NAME"
STACK_DIR="${STACK_DIR:-/opt/stacks/$APP_NAME}"
PORT=${PORT:-9000}

echo "--- 📧 Listmonk Setup ---"
Expand Down Expand Up @@ -135,7 +135,8 @@ sudo docker compose run --rm listmonk ./listmonk --install --yes || echo "Migrat
sudo docker compose up -d

# Health check
source /opt/stackpilot/lib/health-check.sh 2>/dev/null || true
_HC=/opt/stackpilot/lib/health-check.sh
[ -f "$_HC" ] && source "$_HC"
if type wait_for_healthy &>/dev/null; then
wait_for_healthy "$APP_NAME" "$PORT" 60 || { echo "❌ Installation failed!"; exit 1; }
else
Expand All @@ -147,16 +148,23 @@ else
fi
fi

# Enable daily database vacuum (prevents DB bloat)
echo "Enabling daily database vacuum..."
VACUUM_SQL="UPDATE settings SET value='{\"vacuum\": true, \"vacuum_cron_interval\": \"0 2 * * *\"}' WHERE key='maintenance.db';"
{
# Daily vacuum (prevents DB bloat) and bounce processing (without it the bounce webhook returns 503 and bounces are lost)
echo "Enabling daily database vacuum and bounce processing..."
SETTINGS_SQL="UPDATE settings SET value='{\"vacuum\": true, \"vacuum_cron_interval\": \"0 2 * * *\"}' WHERE key='maintenance.db';
UPDATE settings SET value='true' WHERE key IN ('bounce.enabled', 'bounce.webhooks_enabled', 'bounce.ses_enabled');"
if {
if [ -n "$BUNDLED_DB_TYPE" ]; then
sudo docker compose exec -T db psql -U "$DB_USER" -d "$DB_NAME" -c "$VACUUM_SQL"
sudo docker compose exec -T db psql -U "$DB_USER" -d "$DB_NAME" -c "$SETTINGS_SQL"
else
PGPASSWORD="$DB_PASS" psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -c "$VACUUM_SQL"
PGPASSWORD="$DB_PASS" psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -c "$SETTINGS_SQL"
fi
} >/dev/null 2>&1 && echo "✅ Daily vacuum enabled (2:00 AM)" || echo "⚠️ Could not enable vacuum — configure in Settings → Maintenance"
} >/dev/null 2>&1; then
# Listmonk reads settings only at startup.
sudo docker compose restart listmonk >/dev/null
echo "✅ Daily vacuum (2:00 AM) and bounce processing enabled"
else
echo "⚠️ Could not apply settings — enable them in Settings → Maintenance and Settings → Bounces"
fi

# Caddy/HTTPS - configure reverse proxy if domain is set
if [ -n "$DOMAIN" ]; then
Expand Down
21 changes: 21 additions & 0 deletions apps/mailcheap/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY . .
RUN sed -i '/const nextConfig = {/a\ output: "standalone",' next.config.mjs
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build

FROM node:22-bookworm-slim
ARG SOURCE_REF
LABEL org.opencontainers.image.source="https://github.com/marclou/mailcheap" \
org.opencontainers.image.revision="$SOURCE_REF"
WORKDIR /app
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0 PORT=3000
COPY --from=build --chown=node:node /app/.next/standalone ./
COPY --from=build --chown=node:node /app/.next/static ./.next/static
COPY --from=build --chown=node:node /app/public ./public
USER node
EXPOSE 3000
CMD ["node", "server.js"]
Loading
Loading