Skip to content
Back

I am using s3 for app storage but is it possible to keep the build function stuff to local storage?

  • 0
  • 2
  • Self Hosted
  • Functions
  • Sites
  • Storage
Thrawn
28 Apr, 2026, 08:35

_APP_STORAGE_DEVICE=s3 puts everything to the s3 storage but i need to be able to keep the function builds and site in the local and not waste the cloud storage for it

TL;DR
You can keep the build function stuff in local storage by configuring it in the `config.json` of the function. Change `"deploymentRetention": 7` to your desired retention period. Do a CLI push, and remember to use `--activate true` when running from a CI to activate the deployment.
Thrawn
28 Apr, 2026, 08:36

If I set this OPR_EXECUTOR_STORAGE_DEVICE=local does it work?

Chirag Aggarwal
28 Apr, 2026, 08:44

we recommend not using OPR_* env now and kind of deprecated them from executor depending on which version of executor is being used

Chirag Aggarwal
28 Apr, 2026, 08:44

any reason why you want builds to be local only?

Thrawn
28 Apr, 2026, 08:47

If i deploy functions multiple times wont it add up space on the cloud?

Thrawn
28 Apr, 2026, 08:48

I intended cloud to be only for the user uploads

Thrawn
28 Apr, 2026, 08:48

to appwrite storage buckets

28 Apr, 2026, 10:59

you can use deploymentRetention

28 Apr, 2026, 10:59

uh wait no available on self hosted yet

28 Apr, 2026, 11:00

so ig a manual cron job to delete the older builds?

28 Apr, 2026, 11:00

generally its better practice to use s3 for builds etc. local storage was just in case you didnt have s3 set

28 Apr, 2026, 11:49

it is, i'm using it (1.9.0) πŸ™‚ for some reason it's not visible in the UI but configurable with the config.json of the function

28 Apr, 2026, 12:38

Do u know how to do it

28 Apr, 2026, 12:38

How do i do it

28 Apr, 2026, 13:05

my appwrite.json / appwrite.config.json (iirc the second name is the newest)

TypeScript
{
    "projectId": "XXX",
    "functions": [
        {
            "$id": "YYY",
            "name": "Template",
            "runtime": "node-22",
            "buildSpecification": "s-1vcpu-512mb",
            "runtimeSpecification": "s-0.5vcpu-512mb",
            "deploymentRetention": 7,
            "execute": [],
            "events": [],
            "scopes": [
                "databases.read"
            ],
            "schedule": "",
            "timeout": 15,
            "enabled": true,
            "logging": true,
            "entrypoint": "lib/main.js",
            "commands": "npm ci --omit=dev",
            "path": ".",
            "ignore": [
                "node_modules",
                ".git",
                ".gitignore",
                "tsconfig.json",
                "tsconfig.build.json",
                "README.md",
                ".gitlab-ci.yml",
                ".gitlab",
                "src"
            ]
        }
    ]
}
28 Apr, 2026, 13:06

it's "deploymentRetention": 7, to keep them for 7 days before removing the deployment

28 Apr, 2026, 13:06

then you just push the function from the CLI and it will ask to push the properties as well

28 Apr, 2026, 13:09

also if you run from a CI i would recommend using the --activate true to activate the deployment

28 Apr, 2026, 13:15

Okyyy

28 Apr, 2026, 13:15

Thanks

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more