---
title: "Drupal-S3 Module"
description: "# How to Connect PeaSoup S3 to Drupal (S3 Module) Follow these steps to configure Drupal to store and serve files from PeaSoup S3 using the **S3 File System** module. PeaSoup’s S3-compatible API allows for media offloading and performance improvements when integrated…"
url: "https://peasoup.cloud/docs/drupal-s3-module/"
updated: "2024-11-06"
category: "S3-compatible Storage Knowledge Base / Connecting S3 Clients"
---

# Drupal-S3 Module

# How to Connect PeaSoup S3 to Drupal (S3 Module)

Follow these steps to configure Drupal to store and serve files from PeaSoup S3 using the **S3 File System** module. PeaSoup’s S3-compatible API allows for media offloading and performance improvements when integrated with Drupal.

## Prerequisites

- **PeaSoup S3 Access**: Ensure you have the following details:
  - Access key
  - Secret key
  - Bucket name
  - PeaSoup S3 endpoint URL https://**s3.eu-west-1.peasoup.cloud**
- **Drupal** website with administrator access.
- **S3 File System module** installed and enabled in Drupal.

## Steps to Connect PeaSoup S3 to Drupal

1. **Install the S3 File System Module**:
   - Log into your Drupal admin interface.
   - Go to *Extend* and search for the **S3 File System** module.
   - If it’s not already installed, click *Install* next to the module. You can also download it from [Drupal's S3FS module page](https://www.drupal.org/project/s3fs).
   - After installation, go to *Extend* and enable the module.
2. **Configure the S3 File System Module**:
   - Once the module is enabled, go to *Configuration* > *Media* > *S3 File System*.
   - Configure the following settings to integrate PeaSoup S3:
     - **Amazon S3 Bucket Name**: Enter your PeaSoup S3 bucket name.
     - **Access Key**: Enter your PeaSoup S3 access key.
     - **Secret Key**: Enter your PeaSoup S3 secret key.
     - **Region**: Leave this blank unless PeaSoup specifies a region.
     - **Custom S3 Endpoint**: Enter the PeaSoup S3 endpoint https://**s3.eu-west-1.peasoup.cloud**
   - Click *Save Configuration* to apply the settings.
3. **Set File Directory to Use S3**:
   - After configuring PeaSoup S3, you need to tell Drupal to store files on the S3 bucket. Go to *Configuration* > *Media* > *File System*.
   - Set **Default Download Method** to *S3 File System*.
   - In the **Public File System Path**, enter the S3 bucket or folder you want to store files in (e.g., `s3://your-bucket-name`).
   - Click *Save Configuration*.
4. **Test the Connection**:
   - To test the setup, upload a new file via the Drupal media or file management interface.
   - After uploading, check the file URL. It should now point to PeaSoup S3, and the file should be stored in your PeaSoup bucket (e.g., `https://your-bucket.s3.eu-west-1.peasoup.cloud/path-to-your-file`).
5. **Configure Additional Module Settings (Optional)**:
   - The S3 File System module provides additional settings such as:
     - **Object Expiration**: Set the expiration time for objects stored on PeaSoup S3.
     - **Cache-Control Headers**: Control caching behavior for your media files.
     - **File Visibility**: Define whether your files are publicly accessible or private on PeaSoup S3.
   - Adjust these settings according to your needs and click *Save Configuration*.
6. **Move Existing Files to PeaSoup S3 (Optional)**:
   - If you have existing files on your Drupal site that need to be offloaded to PeaSoup S3, the S3 File System module allows you to move them in bulk.
   - Go to the module’s settings page, and look for the option to *Move Local Files to S3*.
   - Follow the prompts to offload your files to PeaSoup S3.

## Optional: Fine-Tune File Storage

- In the S3 File System module settings, you can further fine-tune how files are stored:
  - **Compression**: Enable file compression before uploading to PeaSoup S3 to save space.
  - **Logging**: Enable logging to monitor file uploads and track any errors.
  - **Security**: Enable secure file upload using encryption methods supported by PeaSoup S3.

## Notes

- Ensure that your Drupal server has access to PeaSoup S3 by verifying network and firewall configurations.
- PeaSoup’s S3-compatible API allows seamless integration with Drupal, enabling scalable and cost-effective cloud storage for your site’s media files.
