BEIJING—Alibaba Group Ltd. plans to invest $1 billion in cloud computing globally as it seeks to compete with Amazon.com in web services.

The e-commerce giant said part of the money will go to set up data centers in the Middle East, Japan and Europe. Alibaba’s cloud-computing arm, Aliyun, opened its first overseas data center in Silicon Valley earlier this year and plans to set up another in the eastern U.S.

The...