--- title: "Init Script" slug: "server-initscript-classic" tags: ["Classic", "Server", "init script"] updated: 2026-09-17T09:17:40Z published: 2026-09-17T09:17:40Z canonical: "guide.ncloud-docs.com/server-initscript-classic" --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Init Script Available in Classic Init Script describes the page configuration and script information of the **Init Script** menu, and describes how to create and manage scripts. Init Script is a feature that allows a prewritten script to be run automatically when creating a server. You can utilize this feature in various cases, including when creating multiple servers for the same purpose at once, when periodically creating servers in the same environment, and when management of initial server environment by purpose of use is required. ## Check script information You can check script information on the Init Script page. ### Init Script page From the NAVER Cloud Platform portal, click the **Console** > **Menu** > **All Services** > **Compute** > **Server** > **Init Script** menus, in that order, to view the Init Script page. The Init Script page is laid out as follows: ![server-initscript-classic_screen_ko](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/server-initscript-classic_screen_en.png?sv=2026-02-06&spr=https&st=2026-11-14T05%3A05%3A00Z&se=2026-11-14T06%3A05%3A00Z&sr=c&sp=r&sig=1c36NEsBuTVPFRhD9X%2FkL1NJrHhKv2zLUF1OLIvL2UE%3D) | Field | Description | | --- | --- | | ① Menu name | Name of the menu currently being checked and the number of created scripts | | ② Basic features | Features provided when you initially enter the **Init Script** menu - **[Create Init Script]** button: click to [Create script](/docs/en/server-initscript-classic#%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%83%9D%EC%84%B1) - **[Learn more about the product]** button: click to move to the Server introduction page - **[Refresh]** button: click to refresh the script list | | ③ Post-creation features | Features provided after creating the script - **[Edit]** button: click to [Edit script](/docs/en/server-initscript-classic#%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%88%98%EC%A0%95) - **[Delete]** button: click to [Delete Script](/docs/en/server-initscript-classic#%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%82%AD%EC%A0%9C) | | ④ Search window | Search scripts by script name | | ⑤ Script list | List of created scripts - **Script name**: name entered when creating script - **Description**: description of script - **View/Edit**: click the **[Shortcut]** button to view and edit script information - **OS type**: OS type for installing script - **Creation date and time**: date and time of script creation - **Last edited**: date and time the script was last edited | ## Create script You can directly create a script that will be automatically run when creating servers. The following describes how to create a script. 1. In the Classic environment of the NAVER Cloud Platform console, navigate to **Menu** > **All Services** > **Compute** > **Server**. 2. Click the **Init Script** menu. 3. Click the **[Create script]** button. 4. Specify the script name and the OS type, write the script, and then click the **[Create script]** button. Caution Do not include content that may create security breaches in the script content. In the event of a problem caused by this, you may be held accountable. - You can enter between 3-100 characters of capital and lowercase letters, numbers, hyphens (-), and underbars (_) in the script name. - The content of the script can only be in English. You can't include Korean letters or annotations. - The scripts, such as Python, Perl, Shell, and so on can be used in Linux. In the first line, specify the path of the script you want to run in formats such as `#!/bin/bash`, `#!/usr/bin/env python`, `#!bin/perl`, and so on. - You can only use Visual Basic scripts in Windows. 5. From the Init Script pop-up window, click the **[OK]** button. - The created script is displayed in the list. ## Edit script You can edit the OS type and content of the created scripts. The following describes how to edit the OS type and content of a script. 1. In the Classic environment of the NAVER Cloud Platform console, navigate to **Menu** > **All Services** > **Compute** > **Server**. 2. Click the **Init Script** menu. 3. Click to select the script to edit from the script list, and click the **[Edit]** button. 4. After editing the content, click the **[Edit script]** button. 5. From the Init Script pop-up window, click the **[OK]** button. - The edited information is saved. ## Delete script The following describes how to delete a created script. 1. In the Classic environment of the NAVER Cloud Platform console, navigate to **Menu** > **All Services** > **Compute** > **Server**. 2. Click the **Init Script** menu. 3. Click to select the script to delete from the script list, and click the **[Delete]** button. 4. Check the details in the Delete script pop-up window, and then click the **[OK]** button. - The script is deleted and disappears from the list. ## Create server with script To automatically run the script in the server, you must specify the script in the settings information when creating the server. In the Set server ([New console](/docs/en/server-create-classic#2%EC%84%9C%EB%B2%84%EC%84%A4%EC%A0%951)/[Existing console](/docs/en/server-create-classic#2%EC%84%9C%EB%B2%84%EC%84%A4%EC%A0%952)) step, select the desired script in the **Script** item. Note - Scripts can't be used when creating a server or replica server using a server image. - Even if the server status is displayed as **Running**, the script installation may continue to be in progress. To see whether the installation is completed, check the progress status log. - Linux: /var/log/ncloud-init.log - Windows: C:\Program Files(X86)\NBP\ncloud-init\logs ## Script example See the following script examples: ### Linux server Here are scripts that can be used in a Linux server. #### Install Apache HTTP Server The script for installing Apache HTTP Server is as follows: **Perl script example** ``` #!/usr/bin/perl –w $result = `yum update-to httpd`; if ($result =~ /but not installed/) { print "http available\n"; if ($result =~ /httpd available/) { print "http not installed\n"; $iresult = `yum -y install httpd`; if ($iresult =~ /Complete/) { print "http installed\n"; open (WP, ">/var/www/html/index.html") || die "cannot open index.html\n"; print WP `ifconfig eth0 | grep "inet addr" | awk \'{print \$2}\'`; close(WP); `chkconfig --level 345 httpd on`; `service httpd restart`; } } else { print "http NOT available\n"; } } else { print "http already installed\n"; } ``` **Shell script example** ``` #!/bin/sh result=`yum update-to httpd` if [[ $result =~ *"but not installed"* ]] then if [[ $result =~ *"httpd available"* ]] then echo 'http available' echo 'http not installed' $iresult=`yum -y install httpd` if [[ $iresult =~ *"Complete"* ]] then echo 'http installed' echo 'test' >> /var/www/html/index.html /sbin/chkconfig --level 345 httpd on /sbin/service httpd restart fi else echo 'http Not available' fi else echo 'http already installed' fi ``` ### Windows server Here are scripts that can be used in a Windows server. #### Install Java JDK The script for installing Java JDK is as follows: **Visual Basic script example** ``` LOG_DIRECTORY = "C:\Windows\Temp" DEFAULT_LOG_FILE_PATH = LOG_DIRECTORY + "\init-install.log" Set ws = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") ' logging (file & stdout) Function logInfo(str) WScript.Echo CStr(Now()) + " [INFO]: " + str Set objFile = objFSO.OpenTextFile(DEFAULT_LOG_FILE_PATH, 8, True) objFile.WriteLine CStr(Now()) + " [INFO]: " + str objFile.Close End Function tmp_jdk_download_path="C:\Windows\Temp\jdk.exe" jdk_installer_url="http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-windows-x64.exe" cmd="wget --no-check-certificate --no-cookies --header ""Cookie: oraclelicense=accept-securebackup-cookie"" " + jdk_installer_url + " -O " + tmp_jdk_download_path + " -c" ' download jdk ws.Run cmd,,TRUE WScript.Sleep 5000 javaInstallCmdStr = "C:\Windows\Temp\jdk.exe /s /L C:\Windows\Temp\jdk-install.log" Set oExec1 = ws.Exec(javaInstallCmdStr) Do While oExec1.Status = 0 loginfo "Info: Wait for install JDK to finish." WScript.Sleep 10000 Loop ```