StackScripts

Custom recipes for your Linode

StackScripts

Need a way to quickly get a LAMP stack up and running that's automatically tuned, tweaked and optimized for you? Ever wished there was a way to deploy a Wordpress stack that worked right out of the box? How about an easy way to deploy a cluster of identically configured Linodes?

StackScripts™ provide a flexible way to customize our distribution templates. They're very easy to use — find a StackScript, answer its questions, and click deploy. When the deployment is first booted, the script is executed and does its thing. You can even watch its progress by viewing the console.

StackScripts can be private to your account, shared to the Linode community, or chosen from our library of open source StackScripts. The Linode Manager Users and Grants permission system enables you to restrict who can use or edit your private StackScripts. The Linode API can even manage StackScripts, so management can be rolled into your existing workflow.

Popular StackScripts

linode / LAMP Stack
6231 deployments | 2392 still active| last revision 2 years ago
pantheon_dev / Pantheon Mercury
1470 deployments | 326 still active| last revision 3 months ago
linode / WordPress
1275 deployments | 363 still active| last revision 2 years ago
rnolen / LEMP stack
1162 deployments | 207 still active| last revision 1 year ago
nigma / Security, PostgreSQL/MySQL/MongoDB, Apache, Django
881 deployments | 302 still active| last revision 1 year ago
lillq / Apache, MySQL, Ruby Setup
752 deployments | 232 still active| last revision 1 year ago
macwebguy / LAMP & Basic Firewall
636 deployments | 145 still active| last revision 1 year ago
fjmk / Drupal
563 deployments | 62 still active| last revision 1 year ago
jsmith / Minecraft Multiplayer Server
509 deployments | 168 still active| last revision 1 year ago
recrea / Rails 3 & Ruby 1.9.2
485 deployments | 140 still active| last revision 1 year ago


Developing a StackScript

A StackScript can be written in any language that the target template distro has an interpreter installed. The only requirement is the script starts with a shebang on the first line.

StackScripts are fully integrated into the Linode Manager. A script can specify User Defined Fields (UDFs) using StackScript Markup Language (SSML) that the Linode Deployment Wizard will prompt the user to populate when performing the deployment. UDF name/value pairs are passed as environment variables when your StackScript is executed.

User Defined Fields

SSML defines four types of questions: text input, password input, drop-down "combo" boxes, and a list select. Fields have a name and a label, plus optional attributes:

  • default — specify a default value for the question
  • example — show an example usage in the Deployment Wizard
  • oneof — Create a drop-down
  • manyof — Create a multi-select

If a default attribute is given to the UDF question, it is considered optional; otherwise, a value must be entered during deployment. If the name contains "password", a password input box is used.

The entire script is parsed for UDFs, so stick them anywhere in the script. They begin with <udf and end with > and contain name/value attributes in-between.

UDF Examples

The above SSML would produce the following form on the Linode Deployment Wizard.

Name of your blog optional
Deep Thoughts Admin Password Choose a default theme
You can always change this later Optional Plugins optional

StackScript Includes

It is possible to reference the path of other StackScripts by using the ssinclude tag. For example:

This would do two things: when the disk image is deployed with your StackScript, the contents of StackScriptID 7 would also be deployed. The <ssinclude> tag within your StackScript would be substituted for the path of where StackScript 7 was placed.

StackScripts that are included are not processed for UDFs or other includes, and their distribution list is ignored. The user deploying the StackScript must have the 'use' grant for all StackScripts it references.




Home | Manager | Contact Us | Jobs | Terms of Service | Privacy Policy | ™ © 2003-2012 Linode, LLC. All rights reserved.