Create custom server

Connect and configure an existing server that you already own.


POST/api/servers/custom

Create a custom server

This endpoint allows you to add a custom server to Ploi. After creating the server, you'll need to add the public key to your server and trigger the installation.

Required scopes

Create servers

Required attributes

  • Name
    type
    Type
    string
    Description

    The server type, must be any of these values: server, load-balancer, database-server, redis-server, storage-server

  • Name
    ip
    Type
    string
    Description

    The server's IP address.

  • Name
    ssh_port
    Type
    integer
    Description

    The SSH port the server runs on.

  • Name
    database_type
    Type
    string
    Description

    The type of database to install, must be either: none, mysql, mariadb, postgresql or postgresql13

  • Name
    php_version
    Type
    string
    Description

    The PHP version installed, only applicable on the server type. Must be any of these values: 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4

Optional attributes

  • Name
    name
    Type
    string
    Description

    The server name, cannot contain any special characters and is alpha-numeric, if left empty a random name will be used.

  • Name
    description
    Type
    string
    Description

    Allows you to send in an additional description for your server as note.

Request

POST
/api/servers/custom
curl -X POST "https://ploi.io/api/servers/custom" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "type": "server",
    "name": "awesome-server",
    "ip": "12.34.56.78"
  }'

Response

{
  "id": 1,
  "name": "awesome-server",
  "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA.... [email protected]",
  "ssh_command": "mkdir -p /root/.ssh && touch /root/.ssh/authorized_keys && echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA.... [email protected] >> /root/.ssh/authorized_keys",
  "start_installation_url": "https://ploi.io/api/servers/custom/1/start",
  "message": "Server has been created! Please run the \"ssh_command\" inside this response on your server as root user. After that trigger the \"start_installation_url\" with a POST request to start the actual installation."
}

POST/api/servers/custom/{id}/start

Start installation

After adding the public key to your server, trigger this endpoint to start the installation.

Optional attributes

  • Name
    install_monitoring
    Type
    boolean
    Description

    Allows you to install Ploi monitoring as well, requires Pro plan or higher.

  • Name
    webhook_url
    Type
    url
    Description

    This URL gets triggered by Ploi when installation has completed, you can use this for your own system, this will only send 1 signal, there is no retry schedule.

Request

POST
/api/servers/custom/{id}/start
curl -X POST "https://ploi.io/api/servers/custom/1/start" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Response

{
  "message": "Server installation has started. Please make sure to not to reboot the server or do any actions on it while installation is running."
}