How to Fix WordPress Images Loading From Server IP by Updating Site URL (AWS + Bitnami)

If your WordPress site on AWS Lightsail (Bitnami) starts loading images or assets from an IP address instead of your domain, the issue is almost always incorrect WordPress URL settings.

This commonly happens on AWS Lightsail with Bitnami WordPress, especially after:

  • Cloning a site
  • Migrating environments
  • Creating a dev or staging instance
  • Restoring from a snapshot

Issue:

You might notice image URLs like this:

PLAINTEXT
http://44.196.xx.xx/wp-content/uploads/...

Cause:

WordPress stores its base URLs in the database:

  • siteurl
  • home

If these are set to 127.0.0.1 or an IP, WordPress will rewrite image URLs automatically — even after you re-upload them.

How To Resolve:

1. SSH into your Lightsail instance

BASH
ssh -i "C:\Users\Name\Downloads\your_amazon_pem_file.pem" bitnami@1.1.1.1

Modify the path to where your .pem file is located. Replace 1.1.1.1 with your actual IP address.

2. Check current WordPress URLs

BASH
sudo /opt/bitnami/wp-cli/bin/wp option get siteurl --allow-root
sudo /opt/bitnami/wp-cli/bin/wp option get home --allow-root

If you see http://127.0.0.1, that’s the problem.

3. Update them to your domain

BASH
sudo /opt/bitnami/wp-cli/bin/wp option update siteurl "https://your-site-url.com" --allow-root
sudo /opt/bitnami/wp-cli/bin/wp option update home "https://your-site-url.com" --allow-root

4. Confirm

BASH
sudo /opt/bitnami/wp-cli/bin/wp option get siteurl --allow-root
sudo /opt/bitnami/wp-cli/bin/wp option get home --allow-root

Clear Cache

If you’re using Elementor, go to ElementorToolsRegenerate Files & Data and clear your cache.
If you’re not using Elementor, clear your WordPress cache, server cache, and any CDN cache you have enabled. This ensures no old CSS or media URLs are still pointing to the IP address.

NOTE: While this may resolve issues moving forward, existing content

Continue Exploring

Explore All Guides

Tools We Recommend

Recommended Tools

Shopify

Shopify is one of the most powerful all-in-one eCommerce platforms available today, designed to help anyone—from beginners to…

4.7
Updraft

UpdraftPlus Review – The Easiest Way to Back Up Your WordPress Website If you’re running a WordPress site…

4.7
Free / Pro from $70/yr (2 sites)
Zillion Designs

At manzari.com, we’ve been using Zillion Designs since 2015 as our go-to platform for logo design and brand…

4.5
From $199 (+ 20% processing fee)

Affiliate links — we may earn a commission at no extra cost to you.

About Manzari

Manzari is an independent publisher focused on WordPress, website technology, business software, and practical tech guides. Our goal is to help you choose better tools and make informed decisions with honest, transparent recommendations.

57+
In-depth WordPress guides
23+
Real tools tested & reviewed
21yr
Building with WordPress
100%
No paid placements, ever