Recently while developing an sharepoint-hosted app, I got the below error. The error message is: "Error occurred in deployment step "Installed app for SharePoint": The local SharePoint server is not available. Check that the server is running and connected to the SharePoint Farm".
Also check out:
While developing first I got this error. Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action. I resolved by following this solution
The solution for this is to give db_owner permissions to the account which you are using to deploy the app for all the sharepoint related databases.
For this Open the DataBase, expand Security -> Logins -> right click on the account and go to properties. Then in the properties window, click on User Mappings from the left side. Then you can select the database and slect the permission as db_owner as shown in the fig below and click on OK.
Now the error will not come.