From Wikipedia -
Though octopuses can be difficult to keep in captivity, some people keep them as pets. Octopuses often escape even from supposedly secure tanks, due to their problem-solving skills, mobility and lack of rigid structure.
The variation in size and life span among octopus species makes it difficult to know how long a new specimen can naturally be expected to live. That is, a small octopus may be just born or may be an adult, depending on its species. By selecting a well-known species, such as the California Two-spot Octopus, one can choose a small octopus (around the size of a tennis ball) and be confident that it is young with a full life ahead of it.
Octopuses are also quite strong for their size. Octopuses kept as pets have been known to open the covers of their aquariums and survive for a time in the air in order to get to a nearby feeder tank and gorge themselves on the fish there[citation needed]. Large octopuses have also been known to catch and kill some species of sharks.[44]