Amazon.com Inc. is doubling down to combat a problem that has long bedeviled online retailers: failed package delivery.

The Web giant has quietly installed large metal cabinets—or Amazon Lockers—in grocery, convenience and drugstore outlets that function like virtual doormen, accepting packages for customers for a later pickup. Amazon began putting lockers in Seattle, New York state and near Washington, D.C., about a year ago.

And...