Question

Local development options for DigitalOcean's Spaces

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?


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 14, 2024

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:

https://min.io/

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:

  1. Pull the MinIO Docker Image: First, pull the MinIO image from Docker Hub:

    docker pull minio/minio
    
  2. 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:

    • Expose MinIO on localhost:9000 for the S3 API.
    • Start the MinIO admin console on localhost:9001 for easier management.
  3. Access the MinIO Console: Open the admin console by visiting http://localhost:9001 in your browser and logging in with the following credentials:

    • Username: minioadmin
    • Password: minioadmin
  4. 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:

https://www.digitalocean.com/community/tutorials/how-to-set-up-minio-object-storage-server-in-standalone-mode-on-ubuntu-20-04

Hope that this helps!

- Bobby

alexdo
Site Moderator
Site Moderator badge
October 26, 2024

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

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.