Render Disks

作者 render-osse8f889396634MIT收錄於 2026年10月8日更新於 2026年10月8日

Attaches and manages persistent disks on Render services—mount paths, sizing, snapshots, file transfers, and single-instance constraints. Use when the user needs persistent storage, file uploads, a custom database on disk, CMS media storage, or needs to understand why their service can't scale horizontally or use zero-downtime deploys. Trigger terms: persistent disk, disk, storage, mount path, sizeGB, SSD, file uploads, snapshots, disk restore, ephemeral filesystem.

僅含說明DevOps & Cloud
AI 產生的概覽

指導在 Render 服務上掛載與管理持久磁碟,涵蓋掛載路徑、容量、快照與限制。

功能
此技能提供在 Render 服務上掛載與管理持久 SSD 磁碟的說明,包括掛載路徑選擇、容量設定、快照與檔案傳輸。它記錄了關鍵限制,例如僅支援單一執行個體、無法零停機部署,以及磁碟僅在執行階段可用。它也列出 CMS 媒體儲存、自行管理的資料庫與具狀態基礎架構的常見模式,以及常見錯誤與修正方式。另有一份參考文件說明容量規劃、快照生命週期與還原程序。
適用情境
當使用者在 Render 上需要持久儲存時使用,例如檔案上傳、CMS 媒體或磁碟上的自行管理資料庫。也適用於解釋服務為何無法水平擴充或使用零停機部署,或從磁碟快照還原資料時。
執行需求
需要 Render 付費 Web 服務、私有服務或背景工作程序。不附帶指令碼,僅為說明文件,另有一份參考文件。使用 SCP 傳輸檔案需要 SSH 存取權限。

Render Persistent Disks

Persistent disks are high-performance SSDs you attach to a Render service to preserve filesystem changes across deploys and restarts. Without a disk, services have an ephemeral filesystem—all local file changes are lost on every deploy.

When to Use

  • Storing file uploads, CMS media, or user-generated content
  • Running a self-managed database (MySQL, MongoDB, ClickHouse) on Render
  • Deploying stateful infrastructure (Elasticsearch, Kafka, RabbitMQ, Mattermost)
  • Understanding why scaling is blocked or zero-downtime deploys are disabled
  • Restoring data from an automatic disk snapshot

For managed databases, prefer Render Postgres (render-postgres) or Key Value (render-keyvalue) over self-managed alternatives on disk.

Critical Constraints

These constraints affect architecture decisions. Understand them before attaching a disk:

ConstraintImpact
Single instance onlyCannot scale horizontally (numInstances must be 1, autoscaling not available)
No zero-downtime deploysOld instance stops before new instance starts (brief downtime on each deploy)
Runtime access onlyDisk is not available during buildCommand or preDeployCommand (those run on separate compute)
Not accessible from other servicesOnly the attached service can read/write the disk
Not available on cron jobsAttach to a web service, private service, or background worker instead
Not available on one-off jobsOne-off jobs run on separate compute without disk access
Can increase size, cannot decreaseStart small and grow as needed

Setup

Dashboard

  1. Go to your service's Disks page
  2. Set the mount path (absolute path where persistent data is stored)
  3. Choose a size in GB
  4. Click Add disk — triggers a new deploy

Blueprint

yaml
services:  - type: web    name: cms    runtime: node    plan: starter    region: oregon    buildCommand: npm ci && npm run build    startCommand: npm start    disk:      name: cms-data      mountPath: /var/data      sizeGB: 10

Mount Path

Only files written under the mount path are preserved. Everything else remains ephemeral.

RuntimeSource code pathExample mount path
Node.js, Python, Ruby, Elixir, Rust/opt/render/project/src/opt/render/project/src/uploads
Go/opt/render/project/go/src/github.com/<user>/<repo>.../data
DockerDockerfile's WORKDIR (commonly /app)/app/storage

Disallowed mount paths

Cannot mount at: /, /opt, /opt/render, /opt/render/project, /opt/render/project/src, /home, /home/render, /etc, /etc/secrets.

Subdirectories of these paths are fine (e.g. /opt/render/project/src/uploads).

Snapshots

  • Render creates an automatic snapshot every 24 hours
  • Snapshots are available for at least 7 days
  • Restore from the service's Disks page in the Dashboard
  • Full restore only — you cannot restore individual files
  • Destructive — all changes after the snapshot are lost

Do not restore snapshots for custom database recovery. Use database-native backup tools (mysqldump, mongodump) instead—disk snapshots may capture a corrupted database state.

File Transfers

SCP (via SSH)

bash
# Download from servicescp -s [email protected]_REGION.render.com:/mount/path/file ./local-file
# Upload to servicescp -s ./local-file [email protected]_REGION.render.com:/mount/path/file

Requires SSH access enabled for the service.

Magic-Wormhole

Available on all native runtimes (install manually on Docker):

bash
# On the service shellwormhole send /mount/path/file
# On your local machinewormhole receive

Common Patterns

PatternService typeMount pathNotes
WordPress / Ghost / CMSWeb Service/var/data or /app/contentMedia uploads, SQLite
Self-managed MySQLPrivate Service/var/lib/mysqlUse mysqldump for backups, not disk snapshots
File upload APIWeb Service/opt/render/project/src/uploadsSingle instance constraint
ElasticsearchPrivate Service/usr/share/elasticsearch/dataStateful search infrastructure

Common Mistakes

MistakeFix
Expecting horizontal scaling with a diskNot possible — disk services are single-instance only
Mounting at a disallowed pathUse a subdirectory (e.g. /opt/render/project/src/uploads not /opt/render/project/src)
Reading disk during build or pre-deployThese run on separate compute — move logic to the start command
Restoring disk snapshot for a databaseUse database-native backups instead
Starting with a large disk sizeStart small — you can increase but never decrease

References

DocumentContents
references/sizing-and-snapshots.mdSizing guidance, snapshot lifecycle, restore procedures, cost patterns

Related Skills

  • render-web-services — Deploy lifecycle, health checks (disk disables zero-downtime)
  • render-private-services — Internal services with disks (Elasticsearch, MySQL)
  • render-blueprints — disk field reference in render.yaml
  • render-postgres — Managed database alternative (no disk management needed)

來源與署名

來源:render-oss/render-plugin-claude-code位於skills/render-disks提交e8f8893

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架