Creates a new service from a remote or local template.
Create a service in a new folder from a remote template:
serverless create \
--template-url https://github.com/serverless/examples/tree/v3/... \
--path myServiceCreate a service in a new folder using a local template:
serverless create \
--template-path path/to/my/template/folder \
--path myService--template-urlor-uA remotely hosted template URL. Supports plain Git URLs plus GitHub, GitHub Enterprise, GitLab, Bitbucket, and Bitbucket Server. Required if --template-path is not present.--template-pathThe local path of your template. Required if --template-url is not present.--pathor-pThe path where the service should be created.--nameor-nThe name of the service inserverless.yml. If--pathis omitted, Serverless also uses this as the target directory name.
create:create
serverless create \
--template-url https://github.com/serverless/examples/tree/v3/... \
--path my-new-service \
--name my-new-serviceThis example will download the template into the my-new-service directory. This directory will be created if not present. Serverless will not overwrite an existing target directory when --path is used.
Additionally Serverless will rename the service according to the name you provide. If --path is omitted, Serverless uses --name as the target directory. If --name is omitted, the service name defaults to the target directory's final path segment.
serverless create \
--template-path path/to/my/template/folder \
--path path/to/my/service \
--name my-new-serviceThis will copy the path/to/my/template/folder folder into path/to/my/service. If --name is provided, the copied template's service name will be renamed to my-new-service. If --name is omitted, the service name defaults to the target directory's final path segment.
If neither --path nor --name is provided, Serverless will create a new directory named after the local template folder and preserve the template's existing service name.