Browse articles

Object storage

# Configure the Laravel filesystem with a custom S3 endpoint

Use Linuxteknosia Cloud as an S3 disk in Laravel: the flysystem-aws-s3-v3 package, .env variables, endpoint, path-style addressing, and temporaryUrl.

2 min readUpdated: October 23, 2026[Baca dalam Bahasa Indonesia](/docs/laravel)

Laravel uses Flysystem for the `s3` disk. With the correct endpoint and path-style setting, `Storage::disk('s3')` writes straight to Linuxteknosia Cloud without any change to your application code.

## 1\. Create an access key

Sign in to the dashboard and open **Object storage → Access keys → Create access key**. Copy the access key and secret key: the secret is shown only once. You can restrict the key to a single bucket and set an expiry date. Use the bucket name exactly as shown in the dashboard (Object storage). Bucket names are global, so replace the example `media-example-co` in this guide with your own bucket name.

## 2\. Install the S3 adapter

```bash
composer require league/flysystem-aws-s3-v3 "^3.0"
```

## 3\. Fill in .env

```ini
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=<access key>
AWS_SECRET_ACCESS_KEY=<secret key>
AWS_DEFAULT_REGION=id-jkt-1
AWS_BUCKET=media-example-co
AWS_ENDPOINT=https://storage.linuxteknosia.cloud
AWS_USE_PATH_STYLE_ENDPOINT=true
```

## 4\. Make sure config/filesystems.php reads those variables

Laravel's default `s3` disk already reads the endpoint and path-style setting from `.env`. If your configuration is older, align it with the following.

```php
's3' => [
    'driver' => 's3',
    'key' => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'region' => env('AWS_DEFAULT_REGION'),
    'bucket' => env('AWS_BUCKET'),
    'endpoint' => env('AWS_ENDPOINT'),
    'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
    'throw' => true,
],
```

## 5\. Use it in your application

```php
Storage::disk('s3')->put('avatar/1.webp', $file);
$url = Storage::disk('s3')->temporaryUrl('avatar/1.webp', now()->addMinutes(15));
```

## 6\. CORS for browser uploads

If the browser uploads directly using a presigned URL, configure the bucket's CORS rules in the dashboard (**Object storage → bucket → CORS**) with your application's origin.

## See also

-   [How to use the AWS CLI with Linuxteknosia Cloud](/docs/aws-cli)
-   [Using AWS SDK v3 (Node.js) with Linuxteknosia Cloud](/docs/nodejs)
-   [How to use rclone with Linuxteknosia Cloud](/docs/rclone)

Still need help?

Open a support ticket from the dashboard and our team will reply as soon as possible.

[Help center](/en/help)[Open a ticket](/app/support/new)