How to Create, Delete, or Migrate a Machine to a Private Network

Machines are Linux and Windows virtual machines with persistent storage, GPU options, and free unlimited bandwidth. They’re designed for high-performance computing (HPC) workloads.


A private network is a dedicated network that’s logically isolated from other networks on Paperspace. Within this network, machines and shared drives communicate privately and securely with each other.

Private networks are required for certain features, such as a virtual private network (VPN). Each private network you create is assigned a /24 subnet belonging to the RFC 1918 private IP address space. If you need to change your private network to a specific /24 subnet, you should submit a support ticket to Paperspace support with the specific /24 subnet you want to use. The 24 subnet you want to use must adhere to the RFC 1918 private IP address space.

After you create and assign your machine to a private network, you cannot remove the machine from the private network. You can only migrate your machine to a different private network.

When creating your private network, you need to choose the same datacenter region as the machines you want to add to the network. This is because private networks are region-specific and can only have machines that share the same region.

Create a Private Network

Using the Paperspace Console

To create a private network, go to the Paperspace console, in the top-right corner, click the dropdown menu, select CORE, click the Networks tab, then click CREATE NETWORK to open the Create Private Network window.

In the Create Private Network window, under the Name section, choose a name for your private network.

Under the Region section, click the dropdown menu, then select the region you are creating your private network in. You should choose a region closest to you and your users as well as the same region as the machines you want added to the network.

Afterwards, click CREATE.

The Create Private Network window of the Core dashboard's Networks page.

Using the Paperspace API

When creating a private network using the Paperspace API, you need to provide the following values:

  • name (string): The name of your private network.
  • region (string): The datacenter region your private network belongs to.
How to Create a Private Network Using the Paperspace API
  1. Create an API key to authenticate your requests to your Paperspace account and save it for use.

  2. Send a POST request to https://api.paperspace.com/v1/private-networks. Basic usage looks like this, but you can read the usage docs for more details:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PAPERSPACE_API_KEY" \
  -d '{
        "name": "your-private-network-name",
        "region": "NY2"
      }' \
  "https://api.paperspace.com/v1/private-networks"

Using the Paperspace CLI

When creating a private network using the Paperspace CLI, you need to provide the following values:

  • name (string): The name of your private network.
  • region (string): The datacenter region your private network belongs to.
How to Create a Private Network Using the Paperspace CLI
  1. Install pspace, the Paperspace command-line tool.

  2. Create an API key to authenticate your requests to your Paperspace account and save it for use with pspace.

  3. Use the API key to grant pspace access to your Paperspace account.

pspace login --api-key your-api-key
  1. Finally, run pspace private-network create -F [flags]. Basic usage looks like this, but you can read the usage docs for more details:
pspace private-network create -F --name your-private-network-name --region NY2

Delete a Private Network

You cannot delete a private network if there are machines still attached to it, so first, migrate all machines attached to the private network you want to delete to a different private network.

You cannot migrate machines from an existing private network to a different private network using the Paperspace API or CLI. You need to either migrate the machines using the Paperspace console or deactivate all machines attached to your private network.

Using the Paperspace Console

To delete a private network, go to the Paperspace console, in the top-right corner, click the dropdown menu, select CORE, then click the Networks tab.

In the Networks page, find the private network you want to delete. In the top-right corner of that private network, click , then click Delete to open the Delete Network window, prompting if you want to delete the private network you selected. If you want to delete the network, click DELETE.

Using the Paperspace API

When deleting a private network using the Paperspace API, you need to provide the following values:

  • id (string): The ID of the private network you want to delete.
How to Delete a Private Network Using the Paperspace API
  1. Create an API key to authenticate your requests to your Paperspace account and save it for use.

  2. Send a DELETE request to https://api.paperspace.com/v1/private-networks/{private-network-id}.

curl -X DELETE \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PAPERSPACE_API_KEY" \
  -d '{
        "id": "nwhoe4ox"
      }' \
  "https://api.paperspace.com/v1/private-networks/nwhoe4ox"

Using the Paperspace CLI

When deleting a private network using the Paperspace CLI, you need to provide the following values:

  • id (string): The ID of the private network you want to delete.
How to Delete a Private Network Using the Paperspace CLI
  1. Install pspace, the Paperspace command-line tool.

  2. Create an API key to authenticate your requests to your Paperspace account and save it for use with pspace.

  3. Use the API key to grant pspace access to your Paperspace account.

pspace login --api-key your-api-key
  1. Finally, run pspace private-network delete <private-network-id>.
pspace private-network delete nwhoe4ox

Assign or Migrate a Machine to a Private Network

You cannot migrate machines from an existing private network to a different private network using the Paperspace API or CLI. You can only migrate machines using the Paperspace console.

To assign or migrate a machine to a private network, go to your Paperspace console, in the top-right corner, click the dropdown menu, select CORE, then click the Machines tab. In the Machines section, find and select the machine you want to add a private network to.

On the machine’s overview page, in the top-right corner, click the Settings tab. In the Settings page, under the Private network sub-section, click the toggle to enable your machine to use a private network.

In the Private network sub-section, click the dropdown menu, select the private network you want to add your machine to, then click ATTACH. If you have not created any other private networks on your Paperspace account, create another private network you can use to migrate your machines to.

The Private Network section of the machine's Settings page with the option enabled and a network selected.