Functions How-Tos

Functions are blocks of code that run on demand without the need to manage any infrastructure. Develop on your local machine, test your code from the command line (using doctl), then deploy to a production namespace or App Platform — no servers required. Learn more about functions.


Getting Started

Create and deploy a function using the command line or control panel.
Improve your serverless development with this guidance on invoking, iterating on, and observing DigitalOcean Functions.
Configure the resource limits, runtime, and environment of your DigitalOcean Functions.
Schedule functions to run periodically.
You can invoke long-running functions asynchronously using the doctl command line tool or the Functions REST API. You cannot run functions invoked as web functions asynchronously.
You can destroy individual functions at any time. You can also destroy all functions in a namespace at once by resetting the namespace.
Node.js, Python, and PHP functions include all the files in their directory when deployed. Functions written in Go must use the embed package to refer to these files.
Namespaces are a level of isolation and organization for functions and their settings. All functions and projects must be created in a namespace.
Namespaces are a level of isolation and organization for functions and their settings. All functions and projects must be created in a namespace. Destroying a namespace permanently deletes all of its projects and functions.
Projects contain functions that are grouped into packages and configured by a project.yml file.
You can configure functions to forward console and error logs from the function to a third-party logging service. Functions supports Papertrail, Datadog, and Logtail.
Use App Platform to deploy your Functions as a component of a production app.