[Support Guide] Can I run a web server, HTTP listener, and/or database at Netlify?

Last reviewed by Netlify Support: February 2022

How do I run a server/database at Netlify?

We often get questions about how to run a specific backend server or database at Netlify. Examples of these types of questions include:

  • How to I get my node HTTP listener to respond to requests?
  • How do I start Mongo/MySQL/<insert-some-database-here> running on the server?
  • How can I SSH into my website?

We are here today to answer these questions - and the answer is: you can’t! :hushed:

What do you mean, I cannot run a server or database at Netlify?!

This often comes as a bit of a surprise and there is a good reason for this which this topic hopes to explain.

Netlify is specifically designed for “the Jamstack”: https://jamstack.org/

The Jamstack is not about specific technologies. It’s a new way of building websites and apps that delivers better performance, higher security, lower cost of scaling, and a better developer experience.

A core principle of the Jamstack is that it doesn’t depend on a “web server”. Now, clearly there is still a web server replying to HTTP requests, but the CDN at Netlify only serves static files. What isn’t happening is that a web application, in realtime as the HTTP request is received, dynamically generates a unique version of a web page on the fly using a programming language of some kind. With a Jamstack site, there is no application server or language runtime (meaning no node.js, Ruby, PHP, Python, etc).

If I cannot run a web server, why are you installing node modules (or a specific Ruby version) when I deploy my site?

You can use these languages (Node, Ruby, Python, PHP and many others) to build the site, but you can not use the language on the web server after the site is deployed.

Static site generators, gulp, grunt, webpack, et cetera - these can all be used to build a site at Netlify. After the build and deploy, though, the site is just static files (HTML, JavaScript, CSS, images, fonts, et cetera) served by Netlify’s CDN.

Okay, but I need to run Node/Ruby/PHP (or use a database) for my site to work. Now what?

This is where the A in Jamstack comes in (A = API). Any runtime/dynamic information the page needs is collected using API calls which originate from the end user’s web browser - not the web server.

Jamstack sites can be dynamic and present unique content to individual users. It is just that with the Jamstack, the users browser (not the web server) does this using API calls and JavaScript.

Netlify’s Functions are one way to make your own short-running API endpoints and easily deploy and access via your site at Netlify. You can also access backend services (such as API’s, databases, etc) that are running on other providers. (So, using serverless.com or Heroku for an API endpoint instead of Functions will work too!) Using third-party API’s (like Stripe) is a common practice as well.

If your backend service is hosted with another provider, Netlify can also proxy these API requests. Proxying API calls can be useful if there are Cross-Origin Resource Sharing (CORS) issues (or if you simply want to obfuscate where the API endpoint is - nobody has to know there’s a plain-http connection to your wordpress server happening).

How do I keep from exposing private API keys if the API call happens from the end user’s browser?

This is covered in this common issue in our forums.

What if I must run a server?

Often it is possible to refactor a server-based dynamic site as a Jamstack site. However, if this cannot be done, then it won’t be possible to host the site with Netlify.

For example, if your site requires Internet Information Server (IIS) and the .NET framework, you would have to use a different service.

Can I SSH or FTP into the server?

No, there is no direct access to the servers that make up the CDN nodes at Netlify.

We do offer a great deal of flexibility when deploying. You can deploy using the any of the following:

If you are looking to upload new versions of your site directly from your local system, the netlify CLI’s manual deploy method is the recommended way to do this and the “drag & drop” method in the web UI is even simpler.

Summary

Netlify is designed for a specific type of website: Jamstack sites. Part of the Jamstack design philosophy is that an application runtime isn’t used by the HTTP server. Quoting the Jamstack.org site again:

The thing that they all have in common is that they don’t depend on a web server.

We hope helps to clarify both that application servers and databases cannot be used (outside of APIs) with Netlify sites and why this is the case. If there are other questions about this, please reply here and we’ll do our best to answer. :+1:

8 Likes
Docker deployment
Can I deploy Django on netlify?
How to access on phpmyadmin with netlify
Does Netlify support websocket programming?
Nodemailer works on local, but not works without displayunlockcaptcha on Netlify
Netlify database connection
Uploading files that have a cms system with datatabse
Axios POST Request works on localhost but no longer works after deploying on Netlify
Which framework makes it easy to run tensorflow.js code on backend then show result on website?
How to start a Wordpress website on Netlify
Deploy strapi on netfily
PHP versions do not match
Stripe payments not working on Netlify while working locally and on heroku (with same code)
CORS problem (Netlify functions)
About deployment of the website
I cannot send the contact form through my php file
How would I change my hosting provider?
My build is getting timed out for rails app. Not sure what the build command is
How to host php websites
How to enable node.js server on my website?
How do i deploy a drupal website
Starter Support for server-side ASP.NET Core Blazor
Deploying a website without HTML but with PHP
How to add libraries when building project
Load balancer of a static site
Nodemailer with 535 5.7.3 Authentication unsuccessful
Whitescreen in WordPress "Posts" edit
Starting node.js app
How to fix or drop my php files here
Where do i run netlify from
Host a blazor server app
Can we use our Dockerfile to build an image and deploy it in netlify
[Gatsby] How to store a json in Netlify?
How to block access to the bot?
React App successfully deployed on Netlify, but with date errors
Error: connect ECONNREFUSED 127.0.0.1:8000 on nuxtjs run generate
Deploy a project with laravel and Vuejs
How to deploy SpringBoot App in Netlify?
React-responsive not working on first load
Angular SSR - unable to host - as the build contains two subfolders
How to integrate Sitecake with my website on netlify?
How can I perform deploys through my java program?
Upload error after adding the ads.txt file
Rewrites Not Working When Using Express With Netlify Functions
Any reason why gulp build on netlify deploy doesn't inject css/js in html files?
Inserting big data in SQLite in Android
Express endpoint issues
Server Side Rendering with Nuxt.js and Netlify
Can I move to Netlify?
Deploying a phoenix app on netlify
How to set a .js file running express as my main file
Express-Server with Netlify functions
Create my first Typescript library and create also a demo page using Parcel and Netlify
Trouble with backend deployment -- 404 error
Vue.js form with prerender shows existing form, but keeps sending back 404, could be a redirect issue?
Nextjs and ServerLess Functions
Does Netlify support Gollum?
Is it possible to host a Tor hidden service on netlify?
Can any React app be deployed to Netlify?
How I can Create a free blog wordpress with netlify?
Error From Node Modules Folder When Deploying From Github
Can I redirect users to a Perl script?
Deploy failed due to intl extension for PHP not installed
Support Guides - Or, how to find answers for frequent questions!
[Support Guide] Netlify forms with custom success pages for Gatsby and Nuxt
Ionic App Support
Functions: node-cron fetch from external api and write results to file
Failed to load resource: the server responded with a status of 404 () => php file and js file
How to access static file api server build on nodejs
Can I use Golang to do post-processing of my Jekyll site?
Host a blazor server app
Best Serverless Service to Deploy Vue + MySQL DB App
Email Service in Netlify
How to deploy a Reactjs website backed with REST API and MySQL?
Not able to get SSH key
Moving from glitch to netlify
PHP file not serving
Deploy help with enmap
Deploying goes wrong
PHP form on netlify!
Page Not Found, and no build
Success form not working
Page not found after deploy PHP site
Cant deploy express node.js application to netlify
Custom success page for a from
Can I use Netlify as regular hosting with FTP?
How i can open a php file in netlify
NodeJS support question
How to deploy React+Django app? Do I need to deploy it separately?
The page contains php files.will it deploy?
Page Not Found following publication
Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site
Netlify support for Dotnet Core
CORS errors in production but locally works flawlessly
Participant database problem
Http://www.seedcoseeds.com possible netlify transfer/deployment
Nodejs npmstart heroku etc
Build issue with react-app
MySQL Package not found after deploy
HELP with Delopyment
Content module SSR of blog posts failing with 404 error
Can I host node apps using netlify?
“build.command” failed . i have tried CI= npm run build
I need help uploading a simple node app
PHP support added to Netlify
Using environment variables
The error of deploying the product developed with nuxtjs to Netlify is not resolved
[Support Guide] I’ve deployed my site but I still see "Page not found”
Simple Wordpress setup for noob, basic usage
How to run streamlit hello on netlify
Deploy nodejs api failing - trying to deploy a server on netlify
Site deploy failed Build script returned non-zero exit code: 1
ReactJS Netlify Form POST 404 error
Node.Js/Express API deployment
React + Typescript support (create-react-app with typescript template)
React app built with webpack-dev-server stuck on deploy?
Execute python command
Connection to Heroku backend not working
Deploy TS GraphQL API on Netlify Functions?
Continues deployment of functions with postgresql
How can I host my backend endpoints with Netlify>
How to load css files for ejs files (express app)
Serverless-http timeouts on netlify functions local enviroment
How to deploy an app that uses rollup
How to deploy simple express app from Github to Netlify
PHPBB Forum Deployment
Can I Use this Hosting for Automation Website
Build exceeded maximum allowed runtime
Page Not Found, no index.html
No data no local storage
Deploying an MVC Site to Netlify. Is it possible?
Quasar build then nothing happen,,,
Contact form PHP
How to Move Site here
Multi Page website does not work
Newbie question on deploying project from Github that uses a separate server repo
How do I transfer all website, wordpress and domain?
Express-Server with Netlify functions
Resource not available
Netlify build failing with npm ERR! code ENOWORKSPACES
My project was published but i cannot see it, i get a Page not found error, I know is due to I'm not using .html file in my project but the thing is my project is build with php
My deploy is stuck
Rest API post call from blob object not working (blob object rendered correctly)
Page not found, after deployement
Problem in production with nodemailer
Use netlify environment variables in PHP Project
Deployed site gives 404
WP Forms works locally and I get the notifcation
Is it okay to use netlify as an update server
React/Node app setup and deploy properly
Getting Module not found when deploying a next.js with mongodb in it
JSON Server Doesn't Work on Netlify
Build failing with gyp error
Incremental Static Regeneration (ISR) not working for [slug].js file
Can i host my Django Blog On netlify?
How to hide stripe secret key using lambda function
Demo store on netlify using commercejs
What are the correct comands to deploy a maven project with spring boot?
AMP serverside Rendering
Using Netlify for complex dynamic website?
Does netlify support Nuxt Server-Side Rendered Deployment (Universal SSR) mode websites?
Database Support
How to remove a site altogether
Can i host a node js application in netlify
How to Properly set up DNS records for a locally hosted server on port 25565
Few questions about Netlify + Jekyll
Nuxt server (nuxt build && nuxt start) vs Netlify server (nuxt generate) performance?
Yoast SEO premium for Netlify. Does it exist? Is there an Alternative or Workaround? New to Netlify

Last reviewed in August 2021.