Skip to content
Home
Products
Solutions
Customers Enterprise Community Docs
Support
Live Demo

SaaS Platform Development Guide

This guide shows you how to develop a SaaS application on top of the features already shipped in Community Edition. First deploy OpsAny Community Edition, then add a development environment and start coding. You can call the OpsAny Community Edition APIs directly.

Step 1: Add a PaaSAgent for the Test Environment

  1. Modify the PaaS configuration file
vim /data/opsany/conf/opsany-paas/paas/settings_production.py.paas
# change the CSRF setting below to False
CSRF_COOKIE_HTTPONLY = False

# restart the PaaS container
docker restart opsany-paas-paas
  1. Use the script to deploy a PaaSAgent for the test environment automatically
cd /opt/opsany-paas/install
./saas-dev-install.sh install

PaaSAgent is the Agent of the PaaS platform, used to deploy and manage SaaS applications. It is not installed by default when deploying OpsAny Community Edition and is intended for development and test environments only. This script installs PaaSAgent and RabbitMQ.

  1. Verify in the UI

In the OpsAny Community Edition navigation, open Developer Center - select Server Info - check that the server with the test server category is configured correctly, then click the refresh button. A "refresh succeeded" message confirms it.

Step 2: Start Developing Your SaaS Application

Community Edition provides a frontend framework that matches the OpsAny design language and a backend framework with all integration already done. Follow the instructions in each framework to start local development.

  • Frontend framework overview: Vue 3.0 + Ant Design of Vue
  • Backend framework: Python 3.12 + Django 4.5 + MySQL, MongoDB, Redis

Backend Development Environment

The OpsAny backend framework lets you build on OpsAny Community Edition with unified authentication, unified permissions, notifications, dynamic themes and internationalization already integrated. It works out of the box.

Frontend Development Environment

This is the standard OpsAny SaaS frontend framework. It integrates the OpsAny user system, notifications and menu permission model, so you can start building a SaaS application immediately.

To make Vibe Coding easier, the 2026 framework releases place the frontend framework code in the frontend directory of the backend framework.

How the Test-Environment PaaSAgent Deploys SaaS

Before v2.0.0, SaaS applications were deployed and updated mainly through the PaaSAgent service. PaaSAgent is, as the name suggests, the Agent of PaaS — an Agent the PaaS platform uses to maintain SaaS applications. A PaaS platform can have both a test-environment PaaSAgent and a production-environment PaaSAgent. Development and test environments still use this model today.

PaaSAgent Overview

The paasagent directory is the source directory of the Agent module that corresponds to appengine in the PaaS platform.

Its main responsibilities are: - the Agent must be deployed on the application server - it receives request commands from the upper-layer appengine and executes tasks such as deploying and undeploying SaaS applications (building the application runtime and hosting its processes)

Technology stack: - framework: labstack/echo - python runtime: virtualenv, uwsgi

Dependencies: - paas: with built-in applications, it downloads the SaaS deployment package uploaded by the user from the paas service. - appengine: it calls appengine APIs to write back the SaaS deployment logs.

Directory layout: After a default installation, paasagent mounts the host directory /data/opsany/paas_agent_test/.

.
├── apps
│   ├── Envs                # Python virtual environment for each SaaS
│   ├── logs                # Logs for each SaaS
│   └── projects            # Code and uwsgi configuration for each SaaS
├── paas_agent_config.yaml  # paasagent configuration file; SID and Token must match the fields under Server Info in the Developer Center. sid corresponds to the server ID.
├── paasagent.conf          # Nginx configuration file used to reach uwsgi
└── saasapp                 # Stores built-in application SaaS packages for the Developer Center. Each package is a compressed archive containing Python dependencies and code.

SaaS Package Deployment Flow in PaaSAgent Mode

When a developer clicks deploy under Developer Center - Built-in Applications, Appengine sends a request to PaaSAgent. PaaSAgent calls the /opt/opsany/paas-agent/etc/build/virtualenv/build script to create a Python virtual environment for each SaaS, then starts it with Supervisor and uwsgi.

  1. When you click the upload button, the SaaS package is uploaded and saved to /opt/opsany/paas/paas/media/saas_files/ inside the PaaS container.
  2. When you click the deploy button, PaaSAgent downloads that file from the paas service and saves it into the paasagent container directory. The paas address comes from the PAAS_SERVER_URL parameter configured in paas_agent_config.yaml.
  3. paasagent creates the Python virtual environment for the corresponding saas in that directory.
  4. paasagent extracts the downloaded saas package and installs all dependencies under pkgs.
  5. paasagent creates a supervisor service for the saas and generates the supervisor ini configuration file automatically.
  6. paasagent starts the saas service through supervisor.
  7. It runs the Django migration.

After a SaaS is started with uwsgi, access is proxied through the PaaSAgent Nginx. As a result, after the PaaSAgent container restarts, all SaaS platforms must be started manually.

SaaS Package Deployment Flow in Production Docker Container Mode

Because PaaSAgent has some shortcomings, OpsAny no longer uses it for real SaaS deployments — it is now only used in development environments. Production uses pure Docker containers. The flow is:

  1. Use the /opt/opsany-paas/install/register_online_saas.py script to register the application on the platform automatically (the equivalent of creating an application during development).
  2. Start the container directly with Docker (the equivalent of steps 2-6 in PaaSAgent mode).
  3. Run the Django migration with a script (the equivalent of step 7 in PaaSAgent mode).
  4. Edit the Openresty configuration file with vim /data/opsany/conf/nginx-conf.d/opsany_paas.conf and add the access configuration for the new SaaS.

This Shell-script deployment replaces the deployment operations that PaaSAgent used to perform. Updates work the same way, except the application creation step is skipped — but building and configuring the Docker container is now an extra step. See the examples under the Docker directory of https://gitee.com/unixhot/opsany-saas-framework.

SaaS Package Deployment in Production PaaSAgent Mode

Some users prefer to keep using PaaSAgent in production, so the script now also supports deploying a production PaaSAgent.

# This parameter starts an additional opsany-paas-paasagent-prod container to run production SaaS applications.
./saas-dev-install.sh prod

This avoids the complexity of building Docker containers, but I still recommend the Docker container mode for production deployments.

Document