Amazon.com Inc.’s hot holiday seller, the Echo speaker, is nearly sold out—except in Amazon’s brick-and-mortar stores.

On Amazon’s main website, the Echo and smaller Echo Dot devices—powered by artificial intelligence that allows customers to ask questions, control smart home devices, play music and order on Amazon—aren’t in stock until after Christmas.

However,...