I’m working on a custom WordPress plugin that requires several Node.js dependencies, but my hosting provider doesn’t allow SSH or terminal access. In my local development environment, I typically build my plugin with all the necessary packages, then remove the node_modules directory before uploading to keep file sizes manageable. Once uploaded, I would normally SSH into the server and run npm install to reinstall dependencies.
Since I can’t access the command line on this particular host, I’m wondering what the recommended approach would be. Should I include the entire node_modules folder when uploading my plugin files? Are there any WordPress plugins that can handle npm package management through the admin interface? What do other developers typically do in this situation when they need to deploy plugins with Node.js dependencies but have limited server access?
I’ve encountered this exact scenario multiple times and found a few workable solutions. The most straightforward approach is actually including the compiled/built assets rather than the raw node_modules. Instead of uploading node_modules directly, run your build process locally (webpack, gulp, etc.) and upload only the generated CSS/JS files along with your PHP code.
For cases where you absolutely need server-side Node.js execution, I’ve had success using hosting providers that offer staging environments with SSH access. You can build everything there, then push the complete package to your production environment. Some shared hosting providers also offer limited shell access through cPanel’s Terminal feature, though this varies by host.
Another option is switching to a hosting solution that better supports modern development workflows. Many WordPress-focused hosts now provide Git deployment hooks and build processes that handle npm installations automatically during deployment.
Consider using a CI/CD pipeline approach if you can set up automated deployments. Services like GitHub Actions or GitLab CI can handle your build process remotely, installing dependencies and compiling assets before deploying only the production-ready files to your server. This eliminates the need for SSH access entirely.
Alternatively, you might want to explore containerized solutions or WordPress-specific deployment tools like WP-CLI, which some hosting providers support even without full SSH access. I’ve also seen developers use SFTP-based deployment scripts that handle the build process on a separate server before transferring files.
The key is separating your build environment from your hosting environment completely, rather than trying to work around the hosting limitations.
honestly just bundle everything and upload it. yeah file sizes get huge but if u dont have ssh theres not much choice. i’ve been doing this for years on cheap shared hosting - just zip up ur entire project including node_modules after building locally. takes forever to upload but it works fine once its there.