Create and deploy a function using the command line or control panel.
Functions How-Tos
Generated on 17 Apr 2025
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.
Create
Improve your serverless development with this guidance on invoking, iterating on, and observing DigitalOcean Functions.
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.
Projects contain functions that are grouped into packages and configured by a project.yml file.
Configure
Configure the resource limits, runtime, and environment of your DigitalOcean Functions.
Schedule functions to run periodically.
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.
Deploy and Use
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.
Use App Platform to deploy your Functions as a component of a production app.
Namespaces
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 destroys all of its projects and functions.