Skip to Content
VMX ConsoleScripts

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 -y and DEBIAN_FRONTEND=noninteractive on 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?

On this page