How to deploy Cloud Servers using Custom Scripts

2019-11-21 By Gary 5186 Views layerpanel custom scripts scripts
40 reviews

Cloud Servers may be deployed as per customer requirements. A custom script server deployment is useful in such cases if your deployed server requires custom commands/services to be enabled and installed as per your needs, that are otherwise not available with the default OS configuration.

The LayerPanel v2.0 offers such an option whereby any server can be easily deployed using the customer’s own script for installing install Apache HTTPD service, MySQL service, etc.


For making use of Custom Script deployment, please follow the below steps and this is only applied for Linux OS currently.


  1. Log in to LayerPanel v2.0.

  2. In Dashboard, click Deploy to order/deploy the new Cloud Servers.

  3. In the next page view, scroll down to the Password & Custom Setting section and then mark the check box near Custom Startup Script.

    Customscript1

  4. The custom script with which the server needs to be deployed can then be entered in the Custom Startup Script field.

    Customscript2

NOTE : Input your script command into the format ' {space}{space}-{space}{cmd} '.


Examples for Custom Script:


  1. To add the resolver nameserver IP addresses to the server at the time of server deployment, the below commands can be entered in the Custom Script field.

    - echo nameserver 8.8.8.8 >> /etc/resolv.conf
    - echo nameserver 8.8.4.4 >> /etc/resolv.conf
    


  1. To update a CentOS server with the latest security and binary packages, right after the server has been, the below commands can be used in the Custom Script field.

    - yum update >> /root/yumupdate.txt
    


  1. To update an Ubuntu server with the latest security and binary packages, right after the server has been, the below commands can be used in the Custom Script field.

    - sudo apt-get update >> /root/update.txt
    


  1. To install telnet command in the server at the time of deployment, use the below command that can be entered in the Custom Script field.

    - yum install telnet -y >> /root/telnetinstall.txt
    


  1. To install Apache HTTPD service in the server when it is deployed, the below commands can be entered in the Custom Script field.

    - yum -y install httpd >> /root/httpdinsall.txt
    - systemctl enable httpd >> /root/httpdenable.txt
    - systemctl start httpd.service >> /root/httpdstart.txt
    


  1. To install MySQL service in an Ubuntu server when it is deployed, the below commands can be used in the Custom Script field.

    - sudo apt-get install mysql-server >> /root/mysqlinstall.txt
    

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.