Amazon.com Inc.’s cloud-computing unit signed a deal with VMware Inc. to offer companies the ability to run their computing operations on both their own VMware-equipped data centers and Amazon’s web-based servers.

The deal bolsters the retailer in its competition against cloud providers including Alphabet Inc.’s Google, International Business Machines Corp., and Microsoft Corp. It is a big step for Amazon Web Services, which started out catering to startups that had little or no on-premises operations but increasingly serves...