# Store assets on a storage server

**URL:** https://discourse.getcockpit.com/t/store-assets-on-a-storage-server/1960
**Category:** Support
**Created:** [June 14, 2021, 11:05am UTC](https://discourse.getcockpit.com/t/store-assets-on-a-storage-server/1960 "2021-06-14T11:05:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dvarga](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@dvarga](https://discourse.getcockpit.com/u/dvarga)
#### Post date: [June 14, 2021, 11:05am UTC](https://discourse.getcockpit.com/t/store-assets-on-a-storage-server/1960/1 "2021-06-14T11:05:18Z")

</div>

Hi!

I’m currently hosting Cockpit on a VPS/Droplet (DigitalOcean) and the files that have been uploaded to Cockpit are making huge inbound traffic (transfer limit is 1TB/month). I want to upload all the static assets to a storage server (i don’t want to use any cloud solutions because of their costs, so the CloudStorage plugin is not an option).  
Is it possible to somehow point the storage folder to another server?

Thanks!

---

<div class="post-metadata">

### Author: ![dvarga](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@dvarga](https://discourse.getcockpit.com/u/dvarga)
#### Post date: [June 25, 2021, 10:06am UTC](https://discourse.getcockpit.com/t/store-assets-on-a-storage-server/1960/2 "2021-06-25T10:06:36Z")

</div>

Somebody help me, please!

---

<div class="post-metadata">

### Author: ![abernh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/abernh/32/859_2.png) [@abernh](https://discourse.getcockpit.com/u/abernh)
#### Post date: [July 5, 2021, 8:31am UTC](https://discourse.getcockpit.com/t/store-assets-on-a-storage-server/1960/3 "2021-07-05T08:31:22Z")

</div>

Well, you already mentioned the CloudStorage plugin.

Having a look at its `bootstrap.php` it shows that the point of interest seems to be the `cockpit.filestorages.init` event.

This event is fired here [cockpit/bootstrap.php at 568b0124352f6d27df359e8c19a70d2dd1961e87 · agentejo/cockpit · GitHub](https://github.com/agentejo/cockpit/blob/568b0124352f6d27df359e8c19a70d2dd1961e87/bootstrap.php#L202)

It allows you to alter the `$storages` object (just like the CloudStorage plugin), which is then loaded into the FileStorage class.

I hope this helps a little.

Let us know how your adjustment turned out to hook up a custom server interface

Addition: the FileStorage class uses the PhpLeague Flysystem for the file system adapters. They have a whole list on adapters prepared, including FTP and SFTP, in case that is what your server needs ( [SFTP Adapter - Flysystem](https://flysystem.thephpleague.com/v2/docs/adapter/sftp/) )

---

<div class="post-metadata">

### Author: ![dvarga](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@dvarga](https://discourse.getcockpit.com/u/dvarga)
#### Post date: [July 5, 2021, 9:46pm UTC](https://discourse.getcockpit.com/t/store-assets-on-a-storage-server/1960/4 "2021-07-05T21:46:00Z")

</div>

Hey @abernh, thanks for your reply!

I’m not really familiar with PHP but will have a look on the things that you have mentioned.
