By SalonLynk
I want to set up Spaces for my application and would like to be able to develop locally by targetting some local instance. What options do I have to do this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
I personally would just use the Spaces directly for local development as well.
If you really need a local S3 storage and using the live Spaces bucket is not an option for you, what you could do is to use a service like MinIO which you can run locally:
It’s lightweight, easy to set up, and works perfectly for simulating S3 storage in your local environment.
They also have a Docker image that you could use:
Pull the MinIO Docker Image: First, pull the MinIO image from Docker Hub:
docker pull minio/minio
Run MinIO in a Docker Container: Now, run MinIO in a container with the following command:
docker run -p 9000:9000 -p 9001:9001 --name minio \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data --console-address ":9001"
This will:
localhost:9000
for the S3 API.localhost:9001
for easier management.Access the MinIO Console:
Open the admin console by visiting http://localhost:9001
in your browser and logging in with the following credentials:
minioadmin
minioadmin
Configure Your Application: In your application, configure the environment variables to point to your local MinIO instance. Here’s an example:
S3_ENDPOINT=http://localhost:9000
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_BUCKET=my-local-bucket
You can also check out this tutorial here:
Hope that this helps!
- Bobby
Heya,
I’ll also vote for MinIO if you want something for local development, but as Bobby mentioned you can use Spaces directly for local development as well.
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.