composer require is the command to add packages to a composer project. Dreamhost shared hosting kills this command for using too much memory. To install new packages on Dreamhost shared hosting,
- copy the project to another machine,
composer requireon that machine,
- copy the composer.lock file back to Dreamhost shared hosting, and
composer installon Dreamhost.
Thanks to srosato on the Dreamhost forums.