App deployment simplified. Open source alternative to Google Cloud Run and AWS AppRunner. Easily deploy internal tools across a team.
OpenRun is an Apache-2.0 licensed project building an open source alternative to Google Cloud Run and AWS AppRunner. OpenRun allows you to deploy containerized apps. OpenRun is cross-platform (Linux/Windows/OSX) and provides a GitOps workflow for managing web apps.
OpenRun apps are deployed directly from the git repo, no build step required. For example, OpenRun can be used to deploy Streamlit/Gradio apps, adding OAuth authentication for access control across a team.
This repo hosts the source code for OpenRun. The source for the documentation site openrun.dev is in the docs repo. App specifications, which are templates to create apps, are defined in the appspecs repo. Sample apps are in the apps repo.
OpenRun can be used to:
- Deploy containerized applications, OpenRun will build and manage the container lifecycle
- Automatically generate a form based UI for backend actions
OpenRun supports the following for all apps:
- Declarative app deployment
- Atomic updates (all or none) across multiple apps
- Staging mode for app updates, to verify whether code and config changes work on prod before making them live.
- Preview app creation support, for trying out code changes.
- Support for github integration, apps being directly deployed from github code.
- OAuth and SSO based authentication
- Support for domain based and path based routing at the app level.
- Integration with secrets managers, to securely access secrets.
For containerized apps, OpenRun supports:
- Managing image builds, in dev and prod mode
- Passing parameters for the container
- Building apps from spec, no code changes required in repo for supported frameworks (Flask, Streamlit and repos having a Dockerfile)
- Support for pausing app containers which are idle
For building Hypermedia based apps, OpenRun supports:
- Automatic error handling support
- Automatic creation of ECMAScript modules using esbuild.
- Support for TailwindCSS and DaisyUI watcher integration.
- Automatic SSL certificate creation based on certmagic.
- Backend app code runs in a security sandbox, with allowlist based permissions.
- No build step, the development artifacts are ready for production use.
- Support for application data persistance using SQLite
- Virtual filesystem with content hash based file names backed by SQLite database, enabling aggressive static content caching.
- Brotli compression for static artifacts, HTTP early hints support for performance.
The feature roadmap for OpenRun is:
- Suport for deployment to Kubernetes is planned.
OpenRun manages TLS cert using LetsEncrypt for prod environments. For dev environment, it is recommended to install mkcert. OpenRun will automatically create local certs using mkcert if it is present. Install mkcert and run mkcert -install
before starting OpenRun server. Installing OpenRun using brew will automatically install mkcert.
For container based apps, Docker or Podman or Orbstack should be installed and running on the machine. OpenRun automatically detects the container manager to use.
OpenRun creates an admin
user account as teh system auth for accessing apps. A random password is generated for this account during initial OpenRun server installation. Note down this password for accessing apps if using system auth.
To install on OSX/Linux, run
curl -sSL https://openrun.dev/install.sh | sh
Start a new terminal (to get the updated env) and run openrun server start
to start the OpenRun service.
To install using brew, run
brew tap openrundev/homebrew-openrun
brew install openrun
brew services start openrun
To install on Windows, run
powershell -Command "iwr https://openrun.dev/install.ps1 -useb | iex"
Start a new command window (to get the updated env) and run openrun server start
to start the OpenRun service.
Once OpenRun server is running, to install apps declaratively, open a new window and run
openrun apply --approve github.com/openrundev/openrun/examples/utils.star
To schedule a background sync, which automatically applies the latest app config, run
openrun sync schedule --approve github.com/openrundev/openrun/examples/utils.star
To install apps using the CLI (imperative mode), run
openrun app create --approve github.com/openrundev/apps/system/list_files /files
openrun app create --approve github.com/openrundev/apps/system/disk_usage /disk_usage
openrun app create --approve github.com/openrundev/apps/utils/bookmarks /book
Open https://localhost:25223 to see the app listing. The disk usage app is available at https://localhost:25223/disk_usage (port 25222 for HTTP). The bookmark manager is available at https://localhost:25223/book, the list files app is available at https://localhost:25223/files.
See [installation]({{< ref "installation" >}}) for details. See [config options]({{< ref "configuration" >}}) for configuration options. To enable Let's Encrypt certificates, see [Automatic SSL]({{< ref "configuration/networking/#enable-automatic-signed-certificate" >}}).
The release binaries are also available at releases. See [install from source]({{< ref "installation/#install-from-source" >}}) to build from source.
To install a containerized app, ensure either Docker or Podman is running and run
openrun app create --spec python-streamlit --branch master --approve github.com/streamlit/streamlit-example /streamlit
If the source repo has a Dockerfile
or Containerfile
, run
openrun app create --spec container --approve <source_path> /myapp
to install the app.
To install a release build, follow steps in the installation docs.
To install from source:
- Ensure that a recent version of Go is available, version 1.21.0 or newer
- Checkout the OpenRun repo, cd to the checked out folder
- Build the openrun binary and place in desired location, like $HOME
# Ensure go is in the $PATH
mkdir $HOME/openrun_source && cd $HOME/openrun_source
git clone -b main https://github.com/openrundev/openrun && cd openrun
export OPENRUN_HOME=$HOME/clhome && mkdir -p $OPENRUN_HOME/config
go build -o $OPENRUN_HOME/openrun ./cmd/openrun/
To use the openrun service, you need an initial config file with the service password and a work directory. The below instructions assume you are using $HOME/clhome/openrun.toml as the config file and $HOME/clhome as the work directory location.
- Create the clhome directory
- Create the openrun.toml file, and create a randomly generate password for the admin user account
cd $OPENRUN_HOME
git clone -C config https://github.com/openrundev/appspecs
$OPENRUN_HOME/openrun password > $OPENRUN_HOME/openrun.toml
$OPENRUN_HOME/openrun server start
This will print a random password on the screen, note that down as the password to use for accessing the applications. The service will be started on https://localhost:25223 by default (HTTP port 25222).
OpenRun docs are at https://openrun.dev/docs/. For doc bugs, raise a GitHub issue in the docs repo.
Please use Github Discussions for discussing OpenRun related topics. Please use the bug tracker for bug reports and feature requests.
PRs welcome for bug fixes. For feature enhancements, please first file a ticket with the feature
label and discuss the change before working on the code changes.
The Google go style guide is used for OpenRun. For application behavior related fixes, refer the app unit test cases. Those test run as part of regular unit tests go test ./...
. For API related changes, OpenRun uses the commander-cli library for automated CLI tests. To run the CLI test, run gmake test
from the openrun home directory.