Start by confirming that you can ping the server by its IP address from a client computer over the network. If this works then in config.php on the server try changing references to localhost to the IP address. Save the file and attempt to login from the client on the network again.
If this doesn't work can you post the error message you are receiving?
Once switch while accessing the page from the server you will have to enter the IP address url instead of localhost for it to work. Once the IP address is working you can trying switching to a
domain name if you are assigning one. If it breaks at that point then try pinging the server again from the client but this time us the domain name. If it can't ping then it is probably a dns issue.