core

Fill in a module description here

source

caplogin

 caplogin (server_url:str, server_password:str)

Login to CapRover and return authentication token

Type Details
server_url str CapRover server URL (e.g., https://captain.domain.com/)
server_password str CapRover dashboard password
Returns str Authentication token
token = caplogin(capsrv, cappass)
token[:2]
'ey'

source

setup_app

 setup_app (server_url:str, token:str, app_name:str, volumes:dict=None,
            env_vars:dict=None, instance_count:int=1, force_ssl:bool=True)

Create a new app with SSL enabled and configured settings (combines create_app, enable_ssl, update_app)

Type Default Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app to create and configure
volumes dict None Dict of {volumeName: containerPath} for persistent storage
env_vars dict None Dict of {name: value} for environment variables
instance_count int 1 Number of container instances
force_ssl bool True Force HTTPS redirect
Returns dict API response

source

enable_ssl

 enable_ssl (server_url:str, token:str, app_name:str, timeout:int=120)

Enable HTTPS/SSL for an app’s base domain

Type Default Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app
timeout int 120 Request timeout in seconds (SSL generation can be slow)
Returns dict API response

source

update_app

 update_app (server_url:str, token:str, app_name:str, volumes:dict=None,
             env_vars:dict=None, instance_count:int=1,
             force_ssl:bool=None)

Update app configuration (volumes, env vars, SSL settings)

Type Default Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app to update
volumes dict None Dict of {volumeName: containerPath} for persistent storage
env_vars dict None Dict of {name: value} for environment variables
instance_count int 1 Number of container instances
force_ssl bool None Force HTTPS redirect
Returns dict API response

source

create_app

 create_app (server_url:str, token:str, app_name:str,
             persistent:bool=False)

Register a new app on CapRover

Type Default Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app to create
persistent bool False Whether app needs persistent storage
Returns dict API response
app_name = "mynewapp"
volumes = {"testapi-data": "/app/data"}
env_vars = {"MY_SECRET": "supersecret123"}

setup_app(capsrv, token, app_name, volumes=volumes, env_vars=env_vars)
{'status': 100, 'description': 'Updated App Definition Saved', 'data': {}}

source

deploy

 deploy (server_url:str, token:str, app_name:str, script_paths:str|list,
         requirements:list=None)

Build and deploy a FastHTML app from Python script(s)

Type Default Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app to deploy to
script_paths str | list Path(s) to Python script(s). First script is the entry point
requirements list None List of pip requirements. Defaults to [“python-fasthtml”]
Returns dict API response

source

upload_app

 upload_app (server_url:str, token:str, app_name:str,
             tar_buffer:_io.BytesIO)

Upload and deploy a tar.gz archive to an existing app

Type Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app to deploy to
tar_buffer BytesIO In-memory tar.gz file containing deployment files
Returns dict API response
example_app = """from fasthtml.common import *

app = FastHTML()

@app.route("/")
def home(): return Div(H1("Hello World!"), P("Deployed with CapRover API"))

serve()
"""

Path("example_app.py").write_text(example_app)

deploy(capsrv, token, app_name, "example_app.py", requirements=["python-fasthtml"])
{'status': 100, 'description': 'Deploy is done', 'data': {}}

source

get_app_deployment_logs

 get_app_deployment_logs (server_url:str, token:str, app_name:str)

Get build and deployment logs from an app

Type Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app
Returns str Build/deployment logs

source

get_app_logs

 get_app_logs (server_url:str, token:str, app_name:str,
               encoding:str='ascii')

Get runtime logs from a running app

Type Default Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app
encoding str ascii Log encoding
Returns str Runtime logs
print(get_app_logs(capsrv, token, app_name))
_2025-11-28T15:28:57.924022039Z INFO:     Will watch for changes in these directories: ['/app']
e2025-11-28T15:28:57.924112883Z INFO:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
W2025-11-28T15:28:57.924220463Z INFO:     Started reloader process [1] using WatchFiles
92025-11-28T15:28:57.930583787Z Link: http://localhost:80
D2025-11-28T15:28:58.335346643Z INFO:     Started server process [8]
J2025-11-28T15:28:58.335400954Z INFO:     Waiting for application startup.
G2025-11-28T15:28:58.335540687Z INFO:     Application startup complete.
R2025-11-28T15:28:59.626909551Z INFO:     10.0.1.5:39278 - "GET / HTTP/1.0" 200 OK
R2025-11-28T15:29:06.519078194Z INFO:     10.0.1.5:56198 - "GET / HTTP/1.0" 200 OK
d2025-11-28T15:29:06.695898424Z INFO:     10.0.1.5:56214 - "GET /favicon.ico HTTP/1.0" 404 Not Found

source

delete_app

 delete_app (server_url:str, token:str, app_name:str)

Delete an app from CapRover

Type Details
server_url str CapRover server URL
token str Authentication token from caplogin
app_name str Name of the app to delete
Returns dict API response
delete_app(capsrv, token, app_name)
{'status': 100, 'description': 'App is deleted', 'data': {}}