For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create post-install script

Add a new post-install script to your account, which can then be used after virtual machine installation.

Create post-install script

post

Add a new post-install script to your account, which can then be used after virtual machine installation.

The script contents will be saved to the file /post_install with executable attribute set and will be executed once virtual machine is installed. The output of the script will be redirected to /post_install.log. Maximum script size is 48KB.

Use this endpoint to create automation scripts for VPS setup tasks.

Authorizations
AuthorizationstringRequired

API Token authentication

Body
namestringRequired

Name of the script

Example: My Script
contentstringRequired

Content of the script

Example: #!/bin/bash echo 'Hello, World!'
Responses
200

Success response

application/json
idintegerOptional

Post-install script ID

Example: 325
namestringOptional

Name of the script

Example: My Setup Script
contentstringOptional

Content of the script

Example: #!/bin/bash\napt-get update\napt-get install -y nginx
created_atstring · date-timeOptionalExample: 2025-02-27T11:54:22Z
updated_atstring · date-timeOptionalExample: 2025-03-19T11:54:22Z
post/api/vps/v1/post-install-scripts
POST /api/vps/v1/post-install-scripts HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "name": "My Script",
  "content": "#!/bin/bash\n\necho 'Hello, World!'"
}
{
  "id": 325,
  "name": "My Setup Script",
  "content": "#!/bin/bash\\napt-get update\\napt-get install -y nginx",
  "created_at": "2025-02-27T11:54:22Z",
  "updated_at": "2025-03-19T11:54:22Z"
}

Last updated

Was this helpful?