Appwrite is an open-source backend-as-a-service that abstracts all the complexity involved in building a modern application by providing you with a set of REST APIs for your core backend needs. Appwrite handles user authentication and authorization, real-time databases, cloud functions, webhooks, and much more!
One of the core functionalities of Appwrite is Appwrite Storage. It permits you to upload, view, download, and query your project files. Appwrite Storage not only takes care of encryption, compression and antivirus scans, it’s also built on top of Appwrite’s flexible, yet simple permission system. Appwrite lets you store any files such as text documents, icons, images, videos, and more.
Recently, Appwrite introduced support for Linode as a storage adapter, allowing you to use Appwrite while not having to worry about your storage running out!
To get started we’ll first need to set up our bucket and get our credentials before we can start using Linode Object Storage with Appwrite.
1.Sign up for a Linode account and navigate to Object storage in your Linode console to create a bucket.
2.Once you have your bucket created and configured, you can now go ahead and create your access key and secret. You will be able to do this by navigating to the Access Keys tab present in the Object storage console.
This will give you your access key and secret which we will later use to connect Appwrite with Linode.
3.You will also need to get your region for the integration which you would have chosen when you created your bucket. However, if you can’t remember, your region can be easily found from the endpoint displayed under your bucket.
The format of endpoints for Linode Object Storage looks as follows:
Hence, the region for the bucket we created here is
eu-central-1. Similarly, you can get your region from your endpoint.
With this we conclude the initial setup 💪 and now we will proceed to connect Linode Object Storage with Appwrite.
Before you start, make sure that you have your Appwrite instance up and running. Installation of Appwrite is as simple as running one command:
docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ appwrite/appwrite:latest
To learn more about the installation process, you can check out our installation guide.
We can now start configuring the
.env file to integrate Linode Object Storage with Appwrite.
As a first step, navigate to
_APP_STORAGE_DEVICE in the
.env file and change it from
Local (default) to
Linode. This tells the Appwrite server to use Linode as the storage adapter and to expect Linode credentials in the other environment variables.
You will also need to edit the following .env variables to get Appwrite connected with Linode.
_APP_STORAGE_DEVICE=Linode _APP_STORAGE_DEVICE_LINODE_BUCKET=your bucket name _APP_STORAGE_DEVICE_LINODE_REGION= region _APP_STORAGE_DEVICE_LINODE_SECRET= your secret _APP_STORAGE_DEVICE_LINODE_ACCESS_KEY=your access key
After editing your
.env file, you will need to restart Appwrite. This can be easily done by running the following command.
docker-compose up -d
Once Appwrite has restarted, create a new account and a new project. In the left menu, select ‘Storage’ and create a new bucket. Finally, upload a file into your bucket. You should see your uploaded files in the Linode console as well.
With the newly released provider system for Appwrite Storage service, you can now connect Appwrite with external storage providers instead of storing the files on your system. This prevents exhausting hard drive and bandwidth limits, as well as lets you use your favorite provider alongside Appwrite. And as you have seen in the tutorial above, you can easily connect Appwrite with Linode Object Storage in just a few steps!
If you have a project to share, need help, or simply want to become a part of the Appwrite community, I would love for you to join the official Appwrite Discord server. I can’t wait to see what you build!
You can use the following resources to learn more and get help: