DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
VGSources
Blog

How to Configure Persistent Volumes on Dokku for a Rails App

A practical guide to persisting Rails Active Storage uploads on Dokku, including host-directory setup, mounts, permissions, restarts, scheduler differences, troubleshooting, and backup strategy.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To persist Rails Active Storage uploads on Dokku, mount an app-specific host directory into the container at the directory Rails uses for its local Disk service. A typical setup creates /var/lib/dokku/data/storage/my-rails-app, mounts it at /app/storage, restarts the app, and verifies the mount. The host directory must exist before the mount command runs, and a mount protects files from container replacement on that host but is not a backup.

The instructions below assume the deployed image runs the Rails application from /app. If your image uses another working directory, use the matching absolute container path and set Rails’ Disk root accordingly.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What Dokku persistent storage changes

Dokku containers are replaceable during deploys, restarts, and releases. Files written only inside a container’s writable layer can therefore disappear when that container is replaced. A persistent-volume mount places those writes in a directory on the Dokku host, outside the container lifecycle.

For a Rails application using Active Storage’s local Disk service, the important directory is normally the application’s storage directory. With a working directory of /app, that directory is /app/storage. Mounting a host directory there makes uploaded blobs survive a new container on the same Dokku host.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

The mount is available to containers created for deployment and runtime, not to the image build process. It also masks whatever was already present at the target path inside the image. The container’s original files are not merged with the host directory; they are hidden while the mount is attached.

Choose the host and container paths

Use an app-specific host directory

Keep each application’s data in its own directory, conventionally below /var/lib/dokku/data/storage. For an app named my-rails-app, use:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
/var/lib/dokku/data/storage/my-rails-app

An app-specific directory prevents uploads from different applications from sharing a namespace and makes backup jobs easier to scope. Do not point several unrelated apps at the same directory unless shared data is an intentional design.

Mount to an absolute path in the container

Dokku storage targets must be absolute container paths. The common mapping for a Rails image whose working directory is /app is:

/var/lib/dokku/data/storage/my-rails-app:/app/storage

Confirm the image’s working directory before adopting this exact target. A custom image might run from another directory, in which case Rails.root.join('storage') resolves elsewhere. Mounting /app/storage in that situation can leave Active Storage writing to an unmounted location.

Prepare the host directory and permissions

Create the directory first

Dokku does not create an explicit host path for you. Create it before invoking storage:mount:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo mkdir -p /var/lib/dokku/data/storage/my-rails-app

If the parent directories are absent, the mount command fails instead of provisioning them automatically.

Give the runtime user access

The process running Rails must be able to create directories and files below the mount. For buildpack-based apps, follow Dokku’s documented directory-preparation ownership defaults. For a custom Docker image, determine the effective UID and GID used by the application process and make the host directory writable by that identity. Do not assume that the host’s login user, the Dockerfile’s build user, and the runtime user are the same.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Check both directory traversal and write permission. A directory can appear correctly mounted while uploads fail because the process can read the mount point but cannot write into it. Apply the least privilege that permits the Rails process to create its Active Storage files; avoid making an upload directory world-writable as a shortcut.

Mount the volume with Dokku

Legacy host-to-container syntax

On Docker-local installations, the established command is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dokku storage:mount my-rails-app /var/lib/dokku/data/storage/my-rails-app:/app/storage

The first argument is the Dokku app name. The second contains the existing host path, a colon, and the absolute path inside the container. Keep the host directory dedicated to this app and the container target aligned with Rails’ storage root.

Restart after every storage change

Adding, changing, or removing a mount requires a restart so Dokku recreates the app’s containers with the new configuration:

dokku ps:restart my-rails-app

A restart is not optional cleanup. An already-running container cannot retroactively acquire a changed mount definition.

Verify Dokku’s recorded configuration

After the restart, inspect the app’s storage configuration:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dokku storage:list my-rails-app

You can also request the detailed report:

dokku storage:report my-rails-app

These checks confirm that Dokku knows about the mount. They do not, by themselves, prove that Rails can write to it, so perform an application-level upload test as well.

Configure Rails Active Storage for local disk

Define the Disk service

Rails’ conventional local service in config/storage.yml is:

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
local:
  service: Disk
  root: <%= Rails.root.join("storage") %>

This configuration resolves the root relative to the application directory. When Rails.root is /app, the resulting root is /app/storage, which is the mount target used above.

Select the service in production

In the production environment configuration, select the local service only if storing files on the Dokku host is deliberate:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
config.active_storage.service = :local

Restart or redeploy after changing Rails configuration so the running process loads the new setting. If production already uses an object-storage service, mounting /app/storage will not redirect those uploads; the selected Active Storage service determines where blobs are written.

Check the working-directory assumption

Do not infer the path from a local development checkout. Inspect the deployed image and Rails configuration to confirm the runtime value of Rails.root. A custom Dockerfile, an alternate entrypoint, or a different release layout can change that value. The mount target, Disk root, and actual runtime directory must all refer to the same location.

Test persistence before relying on it

  1. Deploy the app with the mount configured and restart it.
  2. Upload a small file through the normal Active Storage code path.
  3. Confirm the application can download or display that file.
  4. Use dokku storage:list my-rails-app or dokku storage:report my-rails-app to confirm the mount remains registered.
  5. Restart the app again and repeat the download. A successful second request demonstrates survival across container recreation, not merely a successful write to the container layer.

For a stronger check, record the blob’s key, restart, and verify the same record still resolves to the same file. Test both a new upload and a read of an existing upload; permissions that allow one operation can still block the other.

Understand deploy-time behavior and hidden files

Builds cannot use the runtime mount

Dokku makes mounts available to containers created by the deploy and run processes, not during the build process. A buildpack step or Docker build step cannot depend on files that will appear only after the runtime mount is attached. Put application code and build assets in the image or another build-time input.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A mount masks image content

If the image already contains files at /app/storage, attaching the host directory hides those files. Dokku describes this as the container files being overwritten at the mounted path; in practical terms, the directories are not merged. Do not place seed files, default uploads, or required runtime assets under the path that will become a mount unless you copy them into the host directory separately.

Plan migrations deliberately

Before introducing a mount to an existing deployment, identify any files currently inside the container’s storage directory. They will not automatically appear in the new host directory. Copy data through a controlled migration process before or during the change, then restart and verify the application against the mounted location. The same caution applies when changing the host path or removing a mount.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Use named storage entries on newer Dokku installations

Newer Dokku versions support named storage entries, which are useful when scheduler-aware settings or more explicit options are needed. The exact command form depends on the installed Dokku version and scheduler, so check the local command help before applying it.

Create and attach an entry

The supported workflow includes creating a storage entry and attaching it with a container directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dokku storage:create my-rails-app my-rails-storage
 dokku storage:mount my-rails-app my-rails-storage --container-dir /app/storage

Use the actual entry name you create. Named entries can carry additional configuration that is cumbersome in a single host-to-container string.

Scope and options

Dokku’s named-storage features can include process-type scoping, read-only mounts, volume options, and a --replace operation. Process-type scoping matters when only selected processes should see a volume; a web process and a background worker that both handle Active Storage files generally need consistent access to the same data. A read-only mount is appropriate for consumers that must not modify files, not for the process receiving uploads.

Match the scheduler

Legacy host:container syntax remains supported on Docker-local installations but is rejected for k3s apps. A command that works on one scheduler can therefore fail on another even when the paths are correct. Identify whether the app runs under Docker-local or k3s, use the storage syntax supported by that scheduler, and confirm the installed Dokku version’s option names before scripting the setup.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot the common failure modes

The mount command says the host path is missing

Create the complete directory tree with mkdir -p, then rerun the mount. Dokku’s explicit host-path behavior does not auto-create the directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Uploads disappear after a redeploy

Check whether Active Storage is actually using :local, whether its Disk root resolves to the mounted directory, and whether the mount is listed by Dokku. If the app writes to another path, the volume is protecting the wrong directory. If no mount is present, the files were written to the ephemeral container layer.

Rails reports permission denied

Compare the runtime process UID and GID with the ownership and mode of the host directory. Correct the host directory’s ownership according to Dokku’s buildpack defaults or your custom image’s runtime identity. Also check execute permission on every parent directory; access to the final directory alone is insufficient.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Files seem to vanish immediately after attaching the volume

That is the expected masking behavior when the image had pre-existing content at the target. Inspect the host directory, not the hidden image layer, and migrate any required files into the host directory before restarting.

The app still uses a container path after changing storage

Restart the app after changing the mount. Containers created before the change retain their original mount configuration. Verify the registration with storage:list or storage:report, then test an upload and a download.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Docker-local syntax is rejected

If the app is scheduled on k3s, the legacy host:container form is not accepted. Use the scheduler-compatible named-storage workflow and its supported options instead.

Back up the host directory separately

A Dokku mount prevents data loss caused by replacement of a container on the same host. It does not create an independent copy, protect against host-disk failure, or provide disaster recovery. Back up /var/lib/dokku/data/storage/my-rails-app with a system that stores copies outside the live directory, and test restoration.

Keep the backup boundary aligned with the app. Include the Active Storage files and any metadata your recovery plan requires, but do not assume that a database backup alone contains the binary blobs. Conversely, restoring blobs without the corresponding database records can leave unreachable files.

Decide between local Dokku storage and object storage

Rails Active Storage supports cloud services such as Amazon S3 and Google Cloud Storage, as well as Azure Storage and Mirror services. The choice is architectural: local disk is simple and fast to access from one host, while object storage is managed outside the Dokku machine and is designed for portability or shared access.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision area Dokku host mount S3-compatible or other object storage
Durability and backup model Survives container replacement on the same host; you must operate separate backups of the host directory. Durability and replication are provided by the storage service’s design and plan; configure retention and independent backups according to its policy.
Portability across hosts Data is tied to the mounted Dokku host until you copy or restore it elsewhere. Designed for access from multiple hosts and easier migration between deployment nodes.
Operational complexity Requires directory creation, permissions, mount lifecycle, host monitoring, and backup jobs. Requires credentials, bucket or container policy, endpoint configuration, and lifecycle management.
Latency Uses local filesystem access from the app host. Uses network requests to the storage endpoint, so application behavior depends on network and service response time.
Cost Consumes local disk and backup capacity on the Dokku host. Uses the provider’s storage, request, transfer, and optional replication pricing.
Access control Primarily host filesystem ownership, permissions, and Dokku access. Uses service credentials, bucket policies, endpoint controls, and application configuration.
Shared storage across instances Requires all instances to reach the same host-backed data, which a single-host mount does not provide by itself. Multiple app instances can use the same bucket or prefix when configured with compatible credentials and policies.

Choose the local mount when the app is intentionally tied to one Dokku host and you can operate host backups. Prefer object storage when portability, multiple hosts, independently managed durability, or shared access across instances is a requirement. Rails’ environment-specific configuration lets production use object storage while development or a single-host deployment uses local disk.

Production checklist

  • The host directory is app-specific and exists before the mount command.
  • The container target is an absolute path and matches the deployed Rails.root.join('storage') location.
  • The Rails process UID and GID can read and write the host directory.
  • config.active_storage.service selects the intended production service.
  • The app was restarted after every mount change.
  • dokku storage:list or dokku storage:report shows the expected entry.
  • An upload survives a restart and can still be downloaded.
  • Any files previously present at the target were migrated because the mount masks image content.
  • Backups copy the host directory independently and restoration has been tested.
  • The storage syntax matches the app’s scheduler and Dokku version.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.