Skip to content

OCI Container Instances Deployment

AgentCube containers run on OCI Container Instances with an OCI Load Balancer handling TLS termination. Container Instances is Oracle’s managed container service — simpler than OKE (Kubernetes) and appropriate for single-container deployments.

  • OCI account with a compartment for AgentCube resources
  • OCI CLI installed and configured (oci setup config)
  • A VCN with at least one public subnet, or permissions to create one
  • A TLS certificate (from OCI Certificates service, Let’s Encrypt, or your CA)
  • A registered domain name (recommended)

Each OCI CLI command below is shown first for PowerShell 7, then for bash. The PowerShell versions pass arguments as a splatted array and read JSON parameters from files with file://, because inline JSON does not survive PowerShell quoting. Run them from the folder where you save the JSON files.

See Container Images & Specifications for image names, GHCR authentication, and resource requirements.

If you have an existing VCN and public subnet, skip to Step 2. Otherwise, create the required network resources:

PowerShell:

Terminal window
$params = @('network', 'vcn', 'create', '--compartment-id', '{compartment_ocid}', '--cidr-block', '10.0.0.0/16', '--display-name', 'agentcube-vcn')
oci @params

bash:

Terminal window
oci network vcn create \
--compartment-id {compartment_ocid} \
--cidr-block "10.0.0.0/16" \
--display-name "agentcube-vcn"

Note the VCN OCID from the response.

PowerShell:

Terminal window
$params = @('network', 'internet-gateway', 'create', '--compartment-id', '{compartment_ocid}', '--vcn-id', '{vcn_ocid}', '--is-enabled', 'true', '--display-name', 'agentcube-igw')
oci @params

bash:

Terminal window
oci network internet-gateway create \
--compartment-id {compartment_ocid} \
--vcn-id {vcn_ocid} \
--is-enabled true \
--display-name "agentcube-igw"

PowerShell:

Terminal window
@'
[
{
"cidrBlock": "0.0.0.0/0",
"networkEntityId": "{internet_gateway_ocid}"
}
]
'@ | Set-Content -Path route-rules.json
$params = @('network', 'route-table', 'update', '--rt-id', '{default_route_table_ocid}', '--route-rules', 'file://route-rules.json', '--force')
oci @params

bash:

Terminal window
oci network route-table update \
--rt-id {default_route_table_ocid} \
--route-rules '[{
"cidrBlock": "0.0.0.0/0",
"networkEntityId": "{internet_gateway_ocid}"
}]' \
--force

PowerShell:

Terminal window
$params = @('network', 'subnet', 'create', '--compartment-id', '{compartment_ocid}', '--vcn-id', '{vcn_ocid}', '--cidr-block', '10.0.1.0/24', '--display-name', 'agentcube-subnet')
oci @params

bash:

Terminal window
oci network subnet create \
--compartment-id {compartment_ocid} \
--vcn-id {vcn_ocid} \
--cidr-block "10.0.1.0/24" \
--display-name "agentcube-subnet"

Allow inbound HTTPS (443) from the internet to the load balancer, and port 8080 (container) only from inside the VCN, so connectors are never exposed publicly:

PowerShell:

Terminal window
@'
[
{
"protocol": "6",
"source": "0.0.0.0/0",
"tcpOptions": {"destinationPortRange": {"min": 443, "max": 443}}
},
{
"protocol": "6",
"source": "10.0.0.0/16",
"tcpOptions": {"destinationPortRange": {"min": 8080, "max": 8080}}
}
]
'@ | Set-Content -Path ingress-rules.json
$params = @('network', 'security-list', 'update', '--security-list-id', '{default_security_list_ocid}', '--ingress-security-rules', 'file://ingress-rules.json', '--force')
oci @params

bash:

Terminal window
oci network security-list update \
--security-list-id {default_security_list_ocid} \
--ingress-security-rules '[
{
"protocol": "6",
"source": "0.0.0.0/0",
"tcpOptions": {"destinationPortRange": {"min": 443, "max": 443}}
},
{
"protocol": "6",
"source": "10.0.0.0/16",
"tcpOptions": {"destinationPortRange": {"min": 8080, "max": 8080}}
}
]' \
--force

Save the following as containers.json. This example is an Essbase admin-lane connector using the delegated credential posture (delegated_basic): the connector holds no Oracle credential, because you enter the service-account username and password in the Context Engine when you register it.

[
{
"displayName": "agentcube-essbase",
"imageUrl": "ghcr.io/caprusai/agentcube-essbase:{version}",
"ports": [
{
"containerPort": 8080,
"protocol": "TCP"
}
],
"environmentVariables": [
{"name": "AGENTCUBE_CONNECTOR_MODE", "value": "admin"},
{"name": "AGENTCUBE_AUTH_MODE", "value": "delegated_basic"},
{"name": "ESSBASE_SERVER_URL", "value": "{essbase_url}"}
],
"resourceConfig": {
"vcpusLimit": 0.5,
"memoryLimitInGBs": 1
},
"restartPolicy": "ALWAYS"
}
]

Save the following as shape-config.json:

{
"ocpus": 1,
"memoryInGBs": 2
}

Create the container instance. Before you run it, save the GHCR pull secret as pull-secret.json, described below the commands.

PowerShell:

Terminal window
@'
[{"subnetId": "{subnet_ocid}", "assignPublicIp": true}]
'@ | Set-Content -Path vnics.json
$params = @('container-instances', 'container-instance', 'create', '--availability-domain', '{availability_domain}', '--compartment-id', '{compartment_ocid}', '--shape', 'CI.Standard.E4.Flex', '--shape-config', 'file://shape-config.json', '--containers', 'file://containers.json', '--vnics', 'file://vnics.json', '--image-pull-secrets', 'file://pull-secret.json', '--display-name', 'agentcube-essbase')
oci @params

bash:

Terminal window
oci container-instances container-instance create \
--availability-domain {availability_domain} \
--compartment-id {compartment_ocid} \
--shape CI.Standard.E4.Flex \
--shape-config file://shape-config.json \
--containers file://containers.json \
--vnics '[{"subnetId": "{subnet_ocid}", "assignPublicIp": true}]' \
--image-pull-secrets file://pull-secret.json \
--display-name "agentcube-essbase"

The images are in a private registry, so the instance needs the GHCR credentials Caprus AI provided. Save them as pull-secret.json (OCI expects the username and token base64-encoded; you can instead store them in OCI Vault and use a VAULT secret type):

[
{
"secretType": "BASIC",
"registryEndpoint": "ghcr.io",
"username": "{base64_github_username}",
"password": "{base64_github_pat}"
}
]

The public IP gives the container outbound internet access (image pulls, Oracle, and for the Context Engine the licensing service); the Step 1 security rules keep port 8080 reachable only from inside the VCN. For production, you can instead use a private subnet with a NAT gateway and "assignPublicIp": false.

Note the private IP address of the container instance; you use it when you register the connector in Step 6.

Create the Context Engine the same way, as a separate container instance in the same VCN, with image ghcr.io/caprusai/agentcube-ce:{version} on port 8080. The Context Engine needs more resources than a connector: set its container resourceConfig to vcpusLimit 1 and memoryLimitInGBs 2 (the minimum in Container Images), and give the instance a shape config with headroom, for example ocpus 1 and memoryInGBs 4. It also needs:

  • A PostgreSQL database it can reach (for example, OCI Database with PostgreSQL), set in AGENTCUBE_CE_DATABASE_URL. The pgvector extension is required: have your database administrator run CREATE EXTENSION vector; on that database before the Context Engine first starts, or its startup migrations stop with “pgvector extension is required but not installed.”
  • AGENTCUBE_CE_ADMIN_USERNAME and AGENTCUBE_CE_ADMIN_PASSWORD, which create the first admin console login on first startup. They are required only while no admin user exists.
  • AGENTCUBE_CE_CREDENTIAL_KEY, the key that encrypts the credentials and license the Context Engine stores.
  • Outbound HTTPS (443) to https://licensing.caprus.ai. You install the license key in the admin console after the Context Engine is running (Admin & Security → License); no environment variable supplies it.

See Environment Variables for the full Context Engine reference and Production Deployment & Sizing for the reference architecture. Note the Context Engine’s private IP address — the load balancer in the next step fronts the Context Engine, not the connectors.

OCI Container Instances do not include a managed ingress or TLS termination — a separate Load Balancer is required. This is the primary difference from Azure Container Apps. The Load Balancer is the public entry point for the Context Engine; connectors are not added to it.

PowerShell:

Terminal window
'{"minimumBandwidthInMbps": 10, "maximumBandwidthInMbps": 10}' | Set-Content -Path lb-shape.json
'["{subnet_ocid}"]' | Set-Content -Path lb-subnets.json
$params = @('lb', 'load-balancer', 'create', '--compartment-id', '{compartment_ocid}', '--display-name', 'agentcube-lb', '--shape-name', 'flexible', '--shape-details', 'file://lb-shape.json', '--subnet-ids', 'file://lb-subnets.json')
oci @params

bash:

Terminal window
oci lb load-balancer create \
--compartment-id {compartment_ocid} \
--display-name "agentcube-lb" \
--shape-name "flexible" \
--shape-details '{"minimumBandwidthInMbps": 10, "maximumBandwidthInMbps": 10}' \
--subnet-ids '["{subnet_ocid}"]'

Wait for the load balancer to reach ACTIVE state before continuing (typically 2–5 minutes):

PowerShell:

Terminal window
(oci lb load-balancer get --load-balancer-id '{load_balancer_ocid}' | ConvertFrom-Json).data.'lifecycle-state'

bash:

Terminal window
oci lb load-balancer get \
--load-balancer-id {load_balancer_ocid} \
--query 'data."lifecycle-state"'

Note the load balancer’s public IP address from the response.

PowerShell:

Terminal window
$params = @('lb', 'backend-set', 'create', '--load-balancer-id', '{load_balancer_ocid}', '--name', 'agentcube-backends', '--policy', 'ROUND_ROBIN', '--health-checker-protocol', 'HTTP', '--health-checker-port', '8080', '--health-checker-url-path', '/health')
oci @params

bash:

Terminal window
oci lb backend-set create \
--load-balancer-id {load_balancer_ocid} \
--name "agentcube-backends" \
--policy "ROUND_ROBIN" \
--health-checker-protocol "HTTP" \
--health-checker-port 8080 \
--health-checker-url-path "/health"

The Context Engine’s /health endpoint does not require authentication. See Verification for what a healthy response contains.

PowerShell:

Terminal window
$params = @('lb', 'backend', 'create', '--load-balancer-id', '{load_balancer_ocid}', '--backend-set-name', 'agentcube-backends', '--ip-address', '{ce_private_ip}', '--port', '8080')
oci @params

bash:

Terminal window
oci lb backend create \
--load-balancer-id {load_balancer_ocid} \
--backend-set-name "agentcube-backends" \
--ip-address {ce_private_ip} \
--port 8080

OCI Load Balancer requires you to supply the certificate and private key directly.

Section titled “Option A: OCI Certificates Service (recommended for production)”

If your certificate is managed through the OCI Certificates service:

PowerShell:

Terminal window
$params = @('lb', 'certificate', 'create', '--load-balancer-id', '{load_balancer_ocid}', '--certificate-name', 'agentcube-cert', '--certificate-id', '{oci_certificate_ocid}')
oci @params

bash:

Terminal window
oci lb certificate create \
--load-balancer-id {load_balancer_ocid} \
--certificate-name "agentcube-cert" \
--certificate-id {oci_certificate_ocid}

If using a certificate from Let’s Encrypt, your CA, or a self-signed cert:

PowerShell:

Terminal window
$params = @('lb', 'certificate', 'create', '--load-balancer-id', '{load_balancer_ocid}', '--certificate-name', 'agentcube-cert', '--public-certificate', 'file://certificate.pem', '--private-key', 'file://private.pem', '--ca-certificate', 'file://ca-bundle.pem')
oci @params

bash:

Terminal window
oci lb certificate create \
--load-balancer-id {load_balancer_ocid} \
--certificate-name "agentcube-cert" \
--public-certificate file://certificate.pem \
--private-key file://private.pem \
--ca-certificate file://ca-bundle.pem

PowerShell:

Terminal window
@'
{
"certificateName": "agentcube-cert",
"protocols": ["TLSv1.2", "TLSv1.3"]
}
'@ | Set-Content -Path ssl-config.json
$params = @('lb', 'listener', 'create', '--load-balancer-id', '{load_balancer_ocid}', '--name', 'https-listener', '--default-backend-set-name', 'agentcube-backends', '--port', '443', '--protocol', 'HTTPS', '--ssl-configuration', 'file://ssl-config.json')
oci @params

bash:

Terminal window
oci lb listener create \
--load-balancer-id {load_balancer_ocid} \
--name "https-listener" \
--default-backend-set-name "agentcube-backends" \
--port 443 \
--protocol "HTTPS" \
--ssl-configuration '{
"certificateName": "agentcube-cert",
"protocols": ["TLSv1.2", "TLSv1.3"]
}'

Serve the Context Engine on HTTPS only. Do not add a plain HTTP (port 80) listener that forwards to the backend set — it would expose the MCP endpoint unencrypted. If you need an HTTP-to-HTTPS redirect, attach a rule set with a REDIRECT rule to a port-80 listener and open port 80 in the security list; see the OCI Load Balancer documentation on rule sets.

Point your domain at the load balancer’s public IP. Using OCI DNS:

PowerShell:

Terminal window
@'
[
{
"domain": "{ce_hostname}",
"rtype": "A",
"ttl": 300,
"rdata": "{load_balancer_public_ip}"
}
]
'@ | Set-Content -Path dns-items.json
$params = @('dns', 'record', 'rrset', 'update', '--zone-name-or-id', '{zone_name}', '--domain', '{ce_hostname}', '--rtype', 'A', '--items', 'file://dns-items.json', '--force')
oci @params

bash:

Terminal window
oci dns record rrset update \
--zone-name-or-id {zone_name} \
--domain "{ce_hostname}" \
--rtype "A" \
--items '[{
"domain": "{ce_hostname}",
"rtype": "A",
"ttl": 300,
"rdata": "{load_balancer_public_ip}"
}]' \
--force

Step 6: Install Your License and Register the Connector

Section titled “Step 6: Install Your License and Register the Connector”

Sign in to the admin console at https://{ce_hostname}/admin/ with the admin account, open Admin & Security → License, paste the key Caprus AI issued into License key exactly as issued, and select Save. The Context Engine validates the key with the Caprus AI licensing service and stores it, encrypted, only if the service accepts it. The Context Engine must reach https://licensing.caprus.ai over outbound HTTPS (443). Until a valid license is installed, new data sources cannot be added.

Then open Data Sources & Connectors → Connected Systems and register the connector from Step 2. Use http://{connector_private_ip}:8080/mcp as its URL, choose the delegated_basic auth mode, and enter the Oracle service-account username and password. With this delegated credential, every call through the connector reaches Oracle as that one service account; Oracle’s audit trail shows that account. The Context Engine’s audit log records the signed-in user only when Context Engine sign-in (AGENTCUBE_CE_AUTH_MODE=oidc) is enabled. See Connecting Data Sources for the full registration and binding steps.

PowerShell:

Terminal window
Invoke-RestMethod https://{ce_hostname}/health

bash:

Terminal window
curl https://{ce_hostname}/health

Check that license.installed is true and license.status is valid. See Verification for the expected response and full verification checklist.

OCI Container InstancesAzure Container Apps
TLS terminationManual — separate Load Balancer requiredBuilt-in
Managed certificatesManual certificate upload or OCI CertificatesAutomatic via Azure
Networking setupVCN, subnet, security rules requiredMore abstracted
AutoscalingNot supported (fixed instance count)Built-in
Cold startsN/A — always runningPossible if scaled to zero