Hylocereus, as a genus, tend to be tropical vine type cacti. H. undatus is a climbing cactus vine that uses its aerial roots to attach itself to trees, rocks and other surfaces where it will climb to better light for reproduction (flowering is induced via photoperiod). This plant will grow larger indoors if you give it a pole or a branch to climb on to mimic its natural environment. The Dragon fruit plant looks like a prickly plant with many spines, but the spines are soft and won’t hurt.
Dragonfruit plants do not grow well in low light. Indoors give it plenty of bright sunlight. A south-facing window where it gets at least 6 hours of sun is ideal.