Skip to content

Playlist with remote urls

🎧 How to Host MP3s on Linode Object Storage and Embed Them in WordPress

Take control of your file hosting with Linode Object Storage and simplify your WordPress audio playlists. This guide walks you through:

  • Creating a bucket
  • Uploading MP3s
  • Generating playlist shortcode
  • Embedding everything in WordPress

 

πŸ”§ Step 1: Log Into Your Linode Account

  1. Go to: https://cloud.linode.com
  2. Log in to your Linode account
  3. In the left sidebar, click Object Storage

 

πŸ†• Step 2: Create a Bucket

  1. Click Create Bucket
  2. Fill in the following:
    • Label: Something simple, like your-bucket-name
    • Region: Choose the same as your server for low latency (e.g., us-southeast)
    • βœ… Leave Cluster as default
  3. Click Create Bucket

 

πŸ”‘ Step 3: Create Access Keys

  1. Under Object Storage, click the Access Keys tab
  2. Click Create Access Key
  3. Fill in:
    • Label: e.g., wpmp3
    • Bucket: Select your created bucket
  4. Copy and save:
    • Access Key
    • Secret Key ⚠️ You won’t be able to view this again

πŸ’» Using s3cmd with Linode

βœ… Step 1: Install s3cmd

macOS (Homebrew):

brew install s3cmd

Ubuntu/Debian:

sudo apt update
sudo apt install s3cmd

βœ… Step 2: Configure s3cmd for Linode

Run:

s3cmd --configure

Enter the following when prompted:

PromptWhat to Enter
Access KeyFrom Linode Object Storage
Secret KeyFrom Linode Object Storage
S3 Endpointus-east-1.linodeobjects.com
Use HTTPSYes
HTTP ProxyLeave blank
TestType y
SaveType y

πŸ” Settings are saved in ~/.s3cfg

 

 

βœ… Step 3: Apply a Bucket Policy

Create a file named bucket-policy.json and paste this in:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    }
  ]
}

Then run:

s3cmd setpolicy ~/bucket-policy.json s3://your-bucket-name/

Verify:

s3cmd info s3://your-bucket-name/

🎢 Upload Your MP3 Folder

Assuming your local folder is:

/Users/me/Music/beach/

And your bucket is:

s3://your-bucket-name/

Upload everything:

s3cmd put --acl-public --recursive /Users/me/Music/beach/ s3://your-bucket-name/beach/

Breakdown of the command:

  • put: Uploads files
  • --acl-public: Makes files public
  • --recursive: Uploads subfolders
  • /Users/me/Music/beach/: Local source folder
  • s3://your-bucket-name/beach/: Destination in Linode

πŸͺ„ Auto-Generate WordPress Playlist Code

To generate shortcode with public URLs for WordPress:


printf "

βœ” Outputs a clean shortcode
βœ” Removes trailing comma
βœ” Handles filenames with spaces
βœ” Ready to paste into WordPress!

 

 

πŸ“Œ Final Step: Embed It!

Paste the generated code into your WordPress page or post using a shortcode block.

Now you’ve got a custom, public MP3 playlist hosted on Linode and embedded directly into your site. πŸŽ‰

 

printf ‘\n’

'