Ravindra BagaleCourses & study guides

4. Amazon EC2: Launch and Connect to Your Linux Server

4.7 Instance Lifecycle: Stop, Reboot, Terminate

Ha table data javun deil ki bill yet rahil he tharavto – don vela vacha.

  pending ──► running ──► stopping ──► stopped ──► (start) ──► pending
                 │  ▲                                  
          reboot │  │                                  
                 ▼  │                                  
               running ──► shutting-down ──► terminated (gone for ever)
Action What happens Public IP EBS root volume Billing
Reboot OS restarts on same host Kept Kept Continues
Stop Instance shut down; may move to new host on start Released (new one on start); EIP kept Kept Instance charges stop; EBS & EIP still charged
Hibernate RAM saved to EBS, then stop Same as stop Kept Same as stop
Terminate Instance deleted permanently Released Deleted if Delete on termination = yes (default for root) All instance charges stop

Terminate is permanent

Terminated instances cannot be recovered. Enable Termination protection (Actions → Instance settings → Change termination protection) for important servers, and take an EBS snapshot or AMI before experimenting.

Why this matters for security

Forgotten running instances are both a cost risk and a security risk – unpatched, unmonitored servers are easy targets. After every lab, stop or terminate what you don't need and release unused Elastic IPs.

Ravindra Bagale's Tip

After a stop, the public IP changes – many students keep the old IP in DNS or a bookmark and then say "the site has disappeared". If you need a fixed IP, use an Elastic IP (Part 6). And always read the difference between Terminate and Stop twice before you click.

Practice task

Stop your Ubuntu instance, start it again and note the old and new public IP. Then enable termination protection on the Amazon Linux instance.

Thodkyaat sangaycha tar

  • EC2 = virtual server; you choose AMI (OS), instance type (size), key pair (login) and security group (firewall).
  • Security group: 22 from My IP only, 80/443 from anywhere; never open database ports to the internet.
  • chmod 400 mykey.pem; users ec2-user (Amazon Linux) and ubuntu (Ubuntu).
  • Windows: PowerShell OpenSSH (+ icacls), PuTTY (.ppk), or MobaXterm.
  • IMDSv2 protects instance metadata; stop changes the public IP; terminate is permanent.

Samjla ka? Tumcha server ready aahe – aata tya var Linux commands shikuya. Aata pudhe jaauya!