--- title: "associatePublicIpWithServerInstance" slug: "cli-vserver-publicip-associatepublicipwithserverinstance" tags: ["VPC", "Server"] updated: 2026-09-17T10:08:35Z published: 2026-09-17T10:08:35Z canonical: "cli.ncloud-docs.com/cli-vserver-publicip-associatepublicipwithserverinstance" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # associatePublicIpWithServerInstance Available in VPC Assign public IP instances to server instances. ## Syntax The `associatePublicIpWithServerInstance` syntax is as follows: ``` ./ncloud vserver associatePublicIpWithServerInstance \ --publicIpInstanceNo \ --serverInstanceNo \ [--regionCode ] \ [--output ] ``` ## Options This section describes the options available when running `associatePublicIpWithServerInstance`. ### Required options The following options are required for `associatePublicIpWithServerInstance`. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--publicIpInstanceNo` | String | Required | Public IP instance number - See [getPublicIpInstanceList](/docs/en/cli-vserver-publicip-getpublicipinstancelist). | | `--serverInstanceNo` | String | Required | Server instance number - See [getServerInstanceList](/docs/en/cli-vserver-server-getserverinstancelist). | ### Common options For information about the options common to all `vserver` subcommands, see [Server (VPC) options](/docs/en/cli-vserver#%EC%98%B5%EC%85%98). ## Examples If the request to assign a public IP address is successful, the configuration information for the public IP address and the details of the assigned server are returned. ### Command The command example is as follows: ``` ./ncloud vserver associatePublicIpWithServerInstance \ --publicIpInstanceNo 78901234 \ --serverInstanceNo 34567892 \ --regionCode KR \ --output json ``` ### Output The output example is as follows: ``` { "associatePublicIpWithServerInstanceResponse": { "totalRows": 1, "publicIpInstanceList": [ { "publicIpInstanceNo": "78901234", "publicIp": "203.0.113.10", "publicIpDescription": "Test public IP", "createDate": "2026-05-14T19:53:38+0900", "publicIpInstanceStatusName": "Configuring", "publicIpInstanceStatus": { "code": "RUN", "codeName": "In operation" }, "serverInstanceNo": "34567892", "serverName": "public-test-server", "privateIp": "192.0.2.6", "publicIpInstanceOperation": { "code": "SET", "codeName": "SETTING OP" } } ], "requestId": "d4e5f678-9012-3456-def0-456789012345", "returnCode": "0", "returnMessage": "success" } } ```