# Can't start elasticsearch with Ubuntu 16.04

**URL:** https://discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/48730
**Category:** Elasticsearch
**Created:** [April 28, 2016, 8:22pm UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/48730 "2016-04-28T20:22:43Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![fcoelho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fcoelho/32/9841_2.png) [@fcoelho](https://discuss.elastic.co/u/fcoelho)
#### Post date: [June 1, 2016, 2:47am UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/48730/9 "2016-06-01T02:47:25Z")

</div>

It seems that to get Elasticsearch to run on 16.04 you have to set `START_DAEMON` to `true` on `/etc/default/elasticsearch`. It comes commented out by default, and uncommenting it makes Elasticsearch start again just fine.

Be sure to use `systemctl restart` instead of just `start` because the service is started right after installation, and apparently there's some socket/pidfile/something that systemd keeps that must be released before being able to start the service again --- I didn't bother to track that down, feel free to look for it 🙂

Here's a sample `Vagrantfile` for it:

```ruby
Vagrant.configure(2) do |config|
  config.vm.box = 'ubuntu/xenial64'

  config.vm.provision 'shell', inline: <<-SHELL
    sudo apt-get update
    sudo apt-get install elasticsearch -y

    sudo sed -i 's/#START_DAEMON/START_DAEMON/' /etc/default/elasticsearch

    sudo systemctl restart elasticsearch
    systemctl status elasticsearch
  SHELL
end

```

---

_[View the full topic](https://discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/48730)._
