Archerfish can be kept in home aquariums, however they do best in larger aquariums with other archerfish.
They are schooling fish so the tank should have at least 4.  They also prefer vegetation and plenty of hiding places.
Since they learn to shoot their prey to eat, if not given this opportunity and just fed like regular fish, they will eventually forget how.