web3 to function, you need at least one functioning node. It does not have to be on your local system, though.
You could use a remote node and direct the web3 provider to the said node.
Example of free nodes is https://infura.io .
https://infura.io/docs/#introduction for more information
var web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/'));