---
title: How to use Object Storage with Private Networks
description: Configure and use Object Storage with Private Networks.
tags: object storage private-networks private network
dates:
  validation: 2025-08-11
  posted: 2021-05-27
---
import Requirements from '@macros/iam/requirements.mdx'


The [Public Gateway](/public-gateways/concepts/#public-gateway) feature of the [Private Networks](/vpc/concepts/#private-networks) allows Instances in your Private Network to reach resources on the internet without using a public IP address.

This documentation shows how to create an Instance without a public IP address, create a Private Network with a Public Gateway, and a route from your Instance to an Object Storage bucket.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [Object Storage bucket](/object-storage/how-to/create-a-bucket/)

## How to create an Instance without a public IP

Follow the instructions for [creating an Instance](/instances/how-to/create-an-instance/).

You must create an Instance without a flexible IP using the following specifications for our Instance:
  - **Availability Zone**: `nl-ams-1` (or another AZ of your choice).
  - **OS Image**: Ubuntu 20.04 Focal Fossa
  - **Instance type**: DEV1-S
  - **Network configuration**: Untick the selected IP options

## How to create a Private Network and attach the Instance

1. Follow the instructions for [creating a Private Network](/vpc/how-to/create-private-network/). Make sure you create it in the region that encompasses the Availability Zone of the Instance you previously created.
2. Follow the instructions to [attach your Instance to the Private Network](/vpc/how-to/attach-resources-to-pn/).

## How to create a Public Gateway and attach the Private Network

1. Follow the instructions for [creating a Public Gateway](/public-gateways/how-to/create-a-public-gateway/):
    - Select the same Availability Zone as for your previously created Instance.
    - Select a Public Gateway type according to your needs.
    - Select **Allocate a new IP**.
    - Enter a name and optional tags for your Public Gateway.
    After creating your Public Gateway, you are directed to a list of this and any other Public Gateways you have previously created.
2. Click on your new Public Gateway's name. The gateway's dashboard displays.
3. Click the **Private Networks** tab.
4. Click **Attach to a new Private Network**. A pop-up window displays.
5. Select **Attach to an existing Private Network** and pick a Private Network from the drop-down list.
6. Click **Attach to Private Network**.

## How to set the Object Storage Route

1. SSH into your Instance using the following command:
    ```
    ssh root@your_virtual_instance_ip
    ```

    <Message type="note">
    As your Instance has no public IP address, you must connect to it using another Instance in your Private Network or assign a temporary flexible IP to it.
    </Message>

2. Configure the following route to the Object Storage platform:
    ```bash
    # set this to keep the network on the instance
    ip route add 10.0.0.0/8 via `ip route | grep default | awk '{print $3} '` dev ens2
    # dhcp on pn interface
    dhclient ens5
    # change the default route
    ip route del default via `ip route | grep default | awk '{print $3} '` dev ens2
    ip route add default via 192.168.42.1 dev ens5 # use the gateway ip in the gateway's description
    curl https://s3.nl-ams.scw.cloud
    ```

## Conclusion

You have now configured an Instance with a Private Network to communicate with Scaleway's Object Storage platform using a Public Gateway. The gateway ensures the exchange of data between your Private Network and the public Internet.