Report this

What is the reason for this report?

Local development options for DigitalOcean's Spaces

Posted on October 14, 2024

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!

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.

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

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

If you’re working with DigitalOcean Spaces and looking for efficient local development options, especially as a mobile app development company like Dev Technosys, there are several practical tools and setups to streamline the process without always relying on live cloud access.

🚀 Local Development Options for DigitalOcean Spaces:

1. MinIO – Best S3-Compatible Local Emulator

MinIO is a powerful, lightweight object storage server that runs locally and mimics the S3 API used by DigitalOcean Spaces. This is ideal for testing file uploads/downloads in your mobile app backend (like user profile images, documents, etc.).

  • Docker Quick Start:

docker run -p 9000:9000 -p 9001:9001
-e “MINIO_ROOT_USER=admin”
-e “MINIO_ROOT_PASSWORD=admin123”
minio/minio server /data --console-address “:9001”

  • Supports the same SDKs (AWS SDK, Boto3, etc.) you’d use with Spaces.

  • Used internally at Dev Technosys for simulating file workflows during mobile and web app development.

2. LocalStack – Full AWS Service Emulation

If your app relies on more than just storage (like queues or events), LocalStack offers a full AWS cloud stack locally. It’s a heavier setup but perfect for teams that want complete offline testing.

3. Mock S3 Services for Unit Testing

For backend developers at companies like Dev Technosys, using mocking libraries (e.g., moto in Python or aws-sdk-mock in Node.js) can be very effective for testing logic without a live connection.

4. Dedicated Dev Buckets on Spaces (Optional)

If you want to use real Spaces but keep things safe, create a dedicated development bucket with restricted API keys. Automate cleanup and monitor usage to keep it cost-effective.

Final Thoughts

At Dev Technosys, where mobile and web app development are the core, using tools like MinIO allows developers to test file handling, media upload features, and cloud storage integrations locally—saving time and reducing cloud dependency during the early stages of development.

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.