# 如何将安装默认目录 /var 更改为其他目录？

**URL:** <https://meta.discourse.org/t/how-to-change-the-install-default-directory-var-to-other-directory/291627>\
**Category:** Self-hosting\
**Created:** [2024年一月14日 21:13 UTC](https://meta.discourse.org/t/how-to-change-the-install-default-directory-var-to-other-directory/291627 "2024-01-14T21:13:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)\
**Post date:** [2024年一月14日 21:25 UTC](https://meta.discourse.org/t/how-to-change-the-install-default-directory-var-to-other-directory/291627/2 "2024-01-14T21:25:08Z")

</div>

如果将上传和备份移至其他位置，可能会更简单且更符合标准做法，从而释放空间。如果您使用的是 DigitalOcean：

> [@Move Uploads and Backups to DigitalOcean Block Storage](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274):
>
> So you want to move all uploads and backups to [DigitalOcean Block Storage](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-block-storage)? Before you do this, though, you might instead consider [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916). It is no more complicated to set up and provides some other advantages. Setup a Discourse instance on DigitalOcean Setup a Discourse instance on DigitalOcean using our [official guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md). Add a Volume to your droplet [Add](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-block-storage) a block storage volume to your droplet. Note down the name of the volume. In my case t…

---

_[View the full topic](https://meta.discourse.org/t/how-to-change-the-install-default-directory-var-to-other-directory/291627)._
