29

I have uploaded google app java project to production google app engine (from this tutorial), but I can't found any information how to stop or disable the production app engine.

From google developer console, I can shutdown the instance via menu Compute -> Instances, but if I open or access the app's url in the browser, the app instance will start running again.

So how to completely stop or disable Google App Engine production server?

Paul Collingwood
  • 9,053
  • 3
  • 23
  • 36
null
  • 8,669
  • 16
  • 68
  • 98

4 Answers4

59

Late to the game here, the tutorial currently suggests deleting the project, but I wanted to keep the project ID so the suggested option isn't the ideal solution for me.

After spending a good 15 min around the site I've found 2 ways to stop the application. Hope this will be of some help to others until the UI changes again.

Method 1: Disable Application

Go into App Engine, Settings, click on Disable application.

Screenshot of App Engine, Settings

Method 2: Stop Instance

Go into App Engine, Versions, and then click on STOP.

Screenshot of App Engine, Versions

Scott Yang
  • 2,348
  • 2
  • 18
  • 21
  • 2
    Method 2 does not work. Stop is disabled and there is a tooltip saying that stop cannot be done for versions with manual or dynamic scaling. – vap78 Mar 20 '18 at 18:04
  • 2
    You call method 2 "Stop instance" but you describe stopping a version and as @vap78 said it doesn't always work. You *can* stop the instance under "Instances" tab, but when there's a new request to the app, the instance will be started again (only in autoscaling?). – michcio1234 Apr 04 '18 at 09:19
  • Does anybody know how much (or in what concepts) do you get charged even if it is disabled? Thanks – Mike Mar 14 '20 at 18:30
  • How can Method 1 be performed through glcoud CLI? – chava Aug 02 '22 at 23:47
15

Change you code to not serve pages and update the server online, or use the admin console and change the security settings so no one can see it.

i.e. go here.. https://appengine.google.com/ if you have a google app account then you should see that there's a "Disable or Delete Application" section.

demented hedgehog
  • 7,007
  • 4
  • 42
  • 49
  • 4
    Thanks, I have disabled it through menu Administration -> Application Settings. It seems the disable button has been removed in new console page. There is only delete project button in new developer console. – null Nov 29 '14 at 12:58
  • I'm curious, where is the security setting to disable view? – null Nov 29 '14 at 13:00
  • I have an appengine account. When I go to https://appengine.google.com/ I see a list of apps. Click on the one you want to disable. Then the Application Settings menu, then Disable Application is on the page you get taken to. – demented hedgehog Nov 29 '14 at 22:08
  • Well, I already know about "Disable" button as I have mentioned in my 1st comment. What I mean is what you said about "change the security settings so no one can see it". I thought it's a different feature. Thx anyway. – null Dec 01 '14 at 11:01
  • It is. Go to appengine, application settings, authentication type and set it to Google Apps Accounts https://cloud.google.com/appengine/articles/auth That will lock people out. Which is not exactly what you asked for but achieves a similar thing. – demented hedgehog Dec 01 '14 at 22:32
  • I can't found "Google Apps Accounts" option there. In that article link, there is warning: "Currently, you cannot switch authentication options for existing App Engine apps to or from Google Apps Accounts. This option for restricting an application's authentication settings can only be set at or shortly after app creation time." – null Dec 02 '14 at 18:33
  • Oh. That does make sense. Sorry. I was looking at a recent project. – demented hedgehog Dec 02 '14 at 23:28
8

For me none of the other solutions were applicable as I was testing AppEngine on a project that already used Firestore, and disabling the app would disable it as well which was not an option.
I contacted Google and this is the solution they gave me:

You can overwrite the default version of your app by redeploying the app with an empty application and create an app.yaml that uses only static files:

module: default
runtime: python27
api_version: '1.0'
threadsafe: true
handlers:
  - url: /
    static_files: index.html
    upload: index.html
manual_scaling:
  instances: 1

a dummy index.html like:

<title>CLOSED</title>

and deploy it using: gcloud app deploy app.yaml

Then you can stop your app using gcloud app versions stop VERSION_ID

atlanteh
  • 5,615
  • 2
  • 33
  • 54
  • This still costs "Backend Instance Hours". This uses manual scaling instances, so App engine generates HTTP `/_ah/start` requests that end up creating generating "Backend Instance Hours". Is this app free for you? – zino Aug 19 '18 at 18:01
  • I haven't been billed since I did that – atlanteh Aug 19 '18 at 18:44
  • After stopping the service I was not billed actually. – zino Aug 22 '18 at 14:18
  • I'd recommend `- url: /.*` because a simple `- url: /` for example won't necessarily kill your `/api/something` endpoint. – Bugs Bunny Jun 29 '23 at 17:57
6

Go into App Engine > Instances
Select all the instances you want to delete
Click on delete

enter image description here

ehymel
  • 1,360
  • 2
  • 15
  • 24
  • 6
    it seems if you app is using the default Autoscale, if a new request comes in after deleting the instance, app engine spawns another instance... – cevaris Mar 31 '19 at 14:42
  • This won't currently work with the default service type for your deployment – George Udosen Sep 01 '19 at 20:11