---
title: "Back up a server to a Backup Space (SFTP)"
description: "Order a backup space bound to your server, read the SFTP password and send backups with restic or rclone."
url: https://www.gyrohosting.com/developers/en/howto/backup-space.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.44.0
---

# Back up a server to a Backup Space (SFTP)

Order a backup space bound to your server, read the SFTP password and send backups with restic or rclone.

A **Backup Space** is an SFTP space with a hard quota (50 GB to 1 TB, tr-ist-1). It is bound to ONE active server of your account and only that server's IPv4 addresses can connect (port 2201). There is no snapshot: cancelling deletes every file at once. You need the `cloud_order` scope to order and `services_write` to read the password.


## 1. Plans, quote and order

**curl**

```bash
curl -s https://www.gyrohosting.com/api/v1/client/cloud/backup-spaces/plans -H "Authorization: Bearer $GYRO_TOKEN"   # plans + your servers
curl -s -X POST https://www.gyrohosting.com/api/v1/client/cloud/backup-spaces \
  -H "Authorization: Bearer $GYRO_TOKEN" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"plan":"100gb","cycle":"monthly","server_id":12345,"name":"gyro-proje-yedek","confirm":true}'
```

**CLI**

```bash
gyro backup-space plans
gyro backup-space create --plan 100gb --server-id 12345 --name gyro-proje-yedek --dry-run
gyro backup-space create --plan 100gb --server-id 12345 --name gyro-proje-yedek --yes
```

**Terraform**

```hcl
resource "gyro_backup_space" "yedek" {
  plan      = "100gb"
  cycle     = "monthly"
  server_id = 12345
  name      = "gyro-proje-yedek"
}
# host, port, user, path and the sensitive password are attributes
```


## 2. Connection details and password

**curl**

```bash
curl -s https://www.gyrohosting.com/api/v1/client/cloud/backup-spaces/67890 -H "Authorization: Bearer $GYRO_TOKEN"              # state: pending -> active
curl -s https://www.gyrohosting.com/api/v1/client/cloud/backup-spaces/67890/credentials -H "Authorization: Bearer $GYRO_TOKEN"  # host, port, user, password
```

**CLI**

```bash
gyro backup-space get 67890
gyro backup-space credentials 67890 -o json
```


## 3. Send backups from the bound server

**restic**

```
export RESTIC_PASSWORD_FILE=/root/.restic-pass        # restic encrypts; keep this file safe
restic -r sftp://y-m67890@45.87.174.12:2201//veri/restic init
restic -r sftp://y-m67890@45.87.174.12:2201//veri/restic backup /etc /var/www
```

**rclone**

```
rclone config create gyro-yedek sftp host 45.87.174.12 port 2201 user y-m67890 pass "$(rclone obscure "$SFTP_PASSWORD")"
rclone sync /var/backups gyro-yedek:/veri/backups
```

Only `/veri` is writable. A full space refuses new writes (no overage fees). `POST /cloud/backup-spaces/{id}/password` creates a new password (the old one stops at once), `PUT /cloud/backup-spaces/{id}/server` moves the access to another server, size changes use `/cloud/services/{id}/resize-options` and `/resize`. `DELETE /cloud/backup-spaces/{id}?confirm=true&immediate=true` deletes the space and every file permanently.
