Custom deployment scripts used to install software or configure a system on new Compute Instances.
This guide walks you through creating a StackScript through the Cloud Manager.
Open the Create StackScript Form in the Cloud Manager
Set the Label
Add a Description
Select Compatible Distribution Images
Create the Custom Script
Enter a Revision Note
Save the StackScript
Open the Create StackScript Form in the Cloud Manager
Log in to the
Cloud Manager and select StackScripts from the left navigation menu. Click the Create StackScript button. This opens the StackScript Create form.
Set the Label
Within the Label field, enter the label you wish to use identify this StackScript. A good label should provide some indication as to what the StackScript will be used to deploy. The label must be alphanumeric, between 3 and 128 characters, and unique from other StackScript labels on your account.
Add a Description
Enter a brief overview of your StackScript in the Description field, outlining what it does and any software it might be installing or configuring. If you intend on sharing this StackScript with other users on your account or making this StackScript public, this description should be sufficient to help others understand the purpose of the StackScript.
Select Compatible Distribution Images
Within the Target Images field, select each distribution image that is compatible with your StackScript. When deploying a Compute Image based on this StackScript, the available images are limited to whichever images are selected here. At least one image must be selected, though you can add multiple images if you wish to provide an option during deployment. See
Choosing a Linux Distribution to learn more about the distributions that Linode supports.
Create the Custom Script
Paste (or type) your custom script in the Script field. This is the script that the StackScript calls when deploying a Compute Instance. The interpreter needed to execute your script must exist in the distribution images that were previously selected. The first line of the script must include a shebang followed by the path to the interpreter you wish to use.
Bash:#!/bin/bash
Python:#!/usr/bin/env python
Python 3:#!/usr/bin/python3
For more details on the components of a StackScript, see
Write a Custom Script for Use with StackScripts guide.
Enter a Revision Note
Each time you make a change to a StackScript (including creating it), you can set a Revision Note to indicate what changes were made.
Save the StackScript
Once you are finished filling out all required fields, click the Create StackScript button to create the StackScript. After it has been created, you can edit all of the fields as needed. See
Edit a StackScript.
Note
To deploy a new Linode with your StackScript, follow the steps in the
Deploying a New Compute Instance Using a StackScript guide.
StackScripts provide Linode users with the ability to automate the deployment of custom systems on top of Linode’s default Linux distribution images. For example, every time you deploy a new Linode you might execute the same tasks, like updating your system’s software, installing your favorite Linux tools, and adding a limited user account. These tasks can be automated using a StackScript that will perform these actions for you as part of your Linode’s first boot process.
All StackScripts are stored in the Linode Cloud Manager and can be accessed whenever you deploy a Linode. A StackScript authored by you is an Account StackScript. While a Community StackScript is a StackScript created by a Linode community member that has made their StackScript publicly available in the Linode Cloud Manager.
In this Guide
This guide will show you how to do the following:
Note
Account StackScripts
An Account StackScript is any StackScript that you create. It will be stored in the Linode Cloud Manager where you can access it to use when deploying a new Linode. By default, your Account StackScripts are only visible on your account and can only be used by you to deploy a new Linode.
This section will show you how to deploy a new Linode using an Account StackScript and how to access your Account StackScripts.
Note
Deploy a Linode from an Account StackScript
Log into the Linode Cloud Manager.
Click on the Create button at the top of the Linode Cloud Manager and select Linode. This will take you to the Linodes Create page.
Click on the My Images tab to access different sources you can use from which to create a Linode.
Viewing the My Images page, click on the Account StackScripts tab. On this page you will be able to see a list of all of your account’s StackScripts.
From the list, select the StackScript you would like to use to deploy your new Linode instance.
View this StackScript’s Details
To view the details of a StackScript prior to using it to deploy your Linode, click on its Show Details link.
In the StackScript Options section, fill in values for your StackScript’s Options. Not all StackScripts are written to accept option values, so your StackScript might not present this section.
Note
From the Select an Image dropdown menu, select the Linux distribution to use. This list will be limited to the distributions your StackScript supports.
Choose the region where you would like your Linode to reside. If you’re not sure which to select, see our How to Choose a Data Center guide. You can also generate MTR reports for a deeper look at the route path between you and a data center in each specific region.
Select a Linode plan.
Give your Linode a label. This is a name to help you easily identify it within the Cloud Manager’s Dashboard. If desired, assign a tag to the Linode in the Add Tags field.
Create a root password for your Linode in the Root Password field. This password must be provided when you log in to your Linode via SSH. It must be at least 6 characters long and contain characters from two of the following categories:
lowercase and uppercase case letters
numbers
punctuation characters
Click Create. You will be directed back to your new Linode’s Summary page which will report the status of your Linode as it boots up.
Access an Account StackScript
Log into the Linode Cloud Manager.
Click on the StackScripts link in the left-hand navigation menu. You will be brought to the StackScripts page.
Viewing the Account StackScripts tab, you will see a list of all of your account’s StackScripts.
To view the details and contents of an Account StackScript, click on the StackScript you would like to view to access its StackScript detail page.
If you would like to deploy a new Linode from the Account StackScript you are viewing, click on the Deploy New Linode at the top of the StackScript detail page.
You will be brought to the Linodes Create page which will have your Account StackScript selected. Continue to provide the rest of the required configurations to create your Linode. See step 6 in the Deploy a Linode from an Account StackScript section for details on the remaining configurations.
Community StackScripts are any scripts that have been created by a Linode community member and are publicly available via the Linode Cloud Manager. You can deploy a new Linode using any Community StackScript.
This section will show you how to deploy a new Linode using a Community StackScript and how to access the contents of a Community StackScript.
Note
Linode does not verify the accuracy of any Linode Community member submitted StackScripts. Prior to deploying a Linode using a Community StackScript, you should ensure you understand what the script will execute on your Linode.
Log in to your Linode Cloud Manager account.
At the top of the page, click Create and select Linode.
Click on the One-Click tab to access the Create From options.
Viewing the Create From: options, click on the Community StackScripts tab. On this page, you will see a list of all available Community StackScripts.
You can scroll through the list of StackScripts or you can use the Search field to locate the Community StackScript you’d like to use. You can search by StackScript username, label or description. For example, to search for a Community StackScript by username, you can enter username:LinodeApps into the search field.
From the list, select the Community StackScript you would like to use to deploy your new Linode instance.
View this Community StackScript’s Details
To view the details of a StackScript prior to using it to deploy your Linode, click on its Show Details link.
In the StackScript Options section, fill in values for your StackScript’s Options. Not all StackScripts are written to accept option values, so your StackScript might not present this section.
Note
From the Select an Image dropdown menu, select the Linux distribution to use. This list will be limited to the distributions your StackScript supports.
Choose the region where you would like your Linode to reside. If you’re not sure which to select, see our How to Choose a Data Center guide. You can also generate MTR reports for a deeper look at the route path between you and a data center in each specific region.
Select a Linode plan.
Give your Linode a label. This is a name to help you easily identify it within the Cloud Manager’s Dashboard. If desired, assign a tag to the Linode in the Add Tags field.
Create a root password for your Linode in the Root Password field. This password must be provided when you log in to your Linode via SSH. It must be at least 6 characters long and contain characters from two of the following categories:
lowercase and uppercase case letters
numbers
punctuation characters
Click Create. You will be directed back to your new Linode’s Summary page which will report the status of your Linode as it boots up.
Log into the Linode Cloud Manager.
Click on the StackScripts link in the left-hand navigation menu. You will be brought to the StackScripts page.
Click on the Community StackScripts tab. You will see a list of all available Community StackScripts.
You can scroll through the list of StackScripts or you can use the Search field to locate the Community StackScript you’d like to use. You can search by StackScript username, label or description. For example, to search for a Community StackScript by username, you can enter username:LinodeApps into the search field.
To view the details and contents of a Community StackScript, click on the StackScript you would like to view to access its StackScript detail page.
If you would like to deploy a new Linode from the Account StackScript you are viewing, click on the Deploy New Linode at the top of the StackScript detail page.
You will be brought to the Linodes Create page which will have your Community StackScript selected. Continue to provide the rest of the required configurations to create your Linode. See step 6 in the Deploy a Linode from a Community StackScript section for details on the remaining configurations.
Next Steps
After deploying a new Linode using a StackScript you can connect to your Linode via SSH and verify that the StackScript has executed as expected. These steps will vary depending on the StackScript that you used when deploying your Linode.
Note
Depending on the contents of your StackScript, it may take a few minutes for the script to finish executing.
To learn how to create your own StackScript see the A Tutorial for Creating and Managing StackScripts guide.
This guide is published under a CC BY-ND 4.0 license.