Create script
In the Scripts section of the sidebar, click Create script at the top of the page.
Enter the script's Name and a short Description.
Choose the script language: Shell for Linux, or PowerShell for Windows.
Write the script's code in the built-in code editor.
Select the compatible operating systems (Filters) the script can run on.
Click Save to add the script to your own library.
Once saved, the script appears in the Script marketplace under your account's ownership, and you can run it on any compatible virtual machine as described in Running a script.
Tips for writing a script that runs unattended
- Don't make the script wait for your input: it runs without a screen, so use non-interactive options, such as
apt-get install -yandDEBIAN_FRONTEND=noninteractiveon Debian and Ubuntu. - Stop it at the first error: start a Shell script with the line
set -e, so it doesn't carry on after a failed step. - Make it safe to repeat: check whether something exists before creating it, since you may run the script more than once on the same server.
- Don't hard-code passwords in it: generate them inside the script, for example with
openssl rand -base64 18. - Test it first: on a test server, or after taking a snapshot you can go back to.
How is this guide?
Run script
Run one or more scripts from the marketplace or from your own custom scripts on your virtual machine with the Run script option, and set the order they run in.
Virtual networks (VXLAN)
Private networks between servers (VXLAN) are not currently available. Here are alternatives for connecting your servers securely.